Eclipse Open declaration in Java project

Right Click on the project -> Properties -> Project Facets -> Click on the Configuration Link -> Click on Apply Button -> Click on OK button.

The above steps should set your project as a Java project.


If the project is a multi-module Maven project, then you need to import the child/module projects in addition to the parent/pom project. Then ensure that you only open source files via the child project. Java files opened this way will have the Refactor right-click menu item, and F3 Open Declaration etc. work properly. However if the Java file is opened from the parent project, these Eclipse functions will be missing.

It's quite frustrating when opening a file via a Search result, as the file will be found and listed in both the parent and child project. You need to ensure you only work with the file accessed via the child project.

I can't explain precisely what's going on with Eclipse, but it appears that Eclipse does not recognize the parent project as being Java projects, although it will correctly syntax-highlight the Java files whether they are accessed via the parent or child project.


You needed to to check it out as a Java Project, or preferably, its creator should have committed the .project and .classpath files for it.


you can solve the problem by create a new java project. when you check out the project,you should select the default option, [Check out as a project configured using the new project wizard].