Eclipse Open declaration in Java project

后端 未结 14 1679
广开言路
广开言路 2020-12-13 23:28

In an Eclipse SVN project I have a problem; when I tried to open a declaration of one class, I got this error:

Problems opening an editor Reason : projectna         


        
14条回答
  •  醉话见心
    2020-12-13 23:56

    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.

提交回复
热议问题