Eclipse Open declaration in Java project

后端 未结 14 1644
广开言路
广开言路 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:49

    It happens, when libraries are not available on class path of the project where F3 does not work. Select any other project and try to use f3 for navigation. It will work.

    The solution is to add JAR files in your libraries or add libraries in your project. Try to use MAVEN project so that the problem can never occur.

    0 讨论(0)
  • Are you importing a maven project? If you importing a maven project, a file will be viewed in few perspective, especially if you open the file via "Open Resource (Ctrl + Shift + R)".

    Let's look at the example above, "servlet-filter" (mark as 1) imported as maven project, and maven perspective project created in 2. If you open a file in 1, your "Open Declaration F3" will no work, because it is not a valid maven project. It will work if you open the same file in 2.

    Hope this helps.

    0 讨论(0)
  • 2020-12-13 23:54

    Go to Project properties,Select Project Facets then convert to project facets then click Ok then you will able to open editor.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-13 23:57

    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].

    0 讨论(0)
  • 2020-12-14 00:00

    If the format of the project you checked out is of type Maven, you need to convert it to a Maven project first. It may be because the required classes haven't been generated yet. To do this, right-click on the project, click Configure, and then click Convert to Maven Project.

    0 讨论(0)
提交回复
热议问题