Reputation: 190809
I use "F3" key of eclipse for invoking the definition of class, method, or anything.
When I click "F3" key on some class, instead of opening the class in eclipse, it opens the java file that contains the class.
What's wrong with my setup in eclipse?
Upvotes: 2
Views: 963
Reputation: 5698
The problem could be caused by two reasons:
1) the file associations or content-type associations are wrongly configured. This can be fixed navigating to:
Window > Preferences > General > Editors and making sure that:
a) the default (i.e. the first) associated editor for "*.java" is "Java Editor" b) (if a) didn't solve the problem) in the "Content Types" option, the content type "Java Source File" is associated to *.java.
or maybe,
2) if the issue only occurs only to some files (not all of them):
possibly you probably used the option "Open With..." on some of those files and so, Eclipse remembers that choice, so next time you attempt to open any of those files, an external editor is opened instead of the default built-in one.
AFAIK, there are two possible ways of solving this, none of them very elegant but effective:
a) When a certain file is open with the external editor, right click on it and choose "Open With... -> Default Editor". After doing this, that file will not be open with the external editor anymore. Do the same for any other file on the same situation.
b) Use a brand new workspace and import the project from scratch.
Upvotes: 5