0

When I double-click one of the .java files from the Project Explorer, it does not open in the Java Editor. I even tried to open it with Open With -> Java Editor to no avail. I even made sure in Windows -> Preferences -> General -> Editors and made the extension .java default to the Java Editor.

I just got this app virtually finished and I feel like I didn't change anything and now I cannot get a .java file to open. If you look at the screenshot, you can see at the red box that the files seem to be open and at a certain line number and such. Any suggestions how to get these files open and viewable?

enter image description here

beny23
  • 34,390
  • 5
  • 82
  • 85
Matt
  • 3,882
  • 14
  • 46
  • 89

2 Answers2

1

In Eclipse goto
Window->Open perspective->Jave
Window->Reset perspective

Vishal Vijay
  • 2,518
  • 2
  • 23
  • 45
  • I did exactly what you suggested above. Now I see windows on the right and bottom such as ````Task List````, ````Outline```` and such. I still cannot see my java code. The line number and character number (i.e. 54:13) are still visible and if I press up, down, left and right then I can navigate through my code; even though it is not visible. – Matt Mar 08 '13 at 19:01
  • 1
    I think better reinstall a new eclipse – Vishal Vijay Mar 08 '13 at 19:09
  • Oh man, I am scared to touch Eclipse. I would hate to mess things up with my project. I'll back up and try to re-install Eclipse. Thanks Vishal. – Matt Mar 08 '13 at 19:14
  • 1
    I'm re-installing now. I will report back with the result. – Matt Mar 08 '13 at 19:33
  • I just got done with my download and installation. The same result is still happening. I don't know what to do now. – Matt Mar 08 '13 at 20:13
  • Try to create new project and tell me the result – Vishal Vijay Mar 08 '13 at 20:16
  • Same result with a new project. All I did last time was install the new Eclipse without un-installing the original one so my project was still in there. I guess I will try to remove Eclipse completely from my laptop and try again. – Matt Mar 08 '13 at 20:28
  • 1
    That's how you have to do. That's why mentioned there about taking backup of workspace – Vishal Vijay Mar 08 '13 at 20:34
0

In IntelliJ, go to

Settings -> File types -> Files opened in associated applications

Settings -> File types -> Java source files

in any of them, if a exception is shown in the lower panel with the name of the file you can't open, just remove it and apply changes

Community
  • 1
  • 1
tbarderas
  • 55
  • 6