Eclipse “this compilation unit is not on the build path of a java project”

前端 未结 24 2907
故里飘歌
故里飘歌 2020-12-08 03:41

I can\'t get autocompletion to work on Eclipse.

I\'m working on the project on svn. I set up project in Eclipse by going into

File -> Import -> Checkout As

相关标签:
24条回答
  • 2020-12-08 04:12

    Had the same problem (but with Maven). The reason was incorrect choice of executor: my project used global settings that are not avilable from Embedded installation of Maven. Changed it to external (Window -> Preferences -> Maven -> Installations) and that fixed the problem.

    0 讨论(0)
  • 2020-12-08 04:12

    Had the same problem. Solution: Context menu -> Maven -> Enable dependency management

    Do not know why that was lost, when checking out.

    0 讨论(0)
  • 2020-12-08 04:17

    in my case it's a maven project

    delete the project from eclipse leaving the sources close eclipse delete from filesystem

    .target/ .classpath .project .settings/ open eclipse Again Import Maven Projects

    This solved the problem

    0 讨论(0)
  • 2020-12-08 04:18

    Like the message says, is the file somewhere on the project's Java Build Path (e.g. a Source folder)?

    0 讨论(0)
  • 2020-12-08 04:19
    mvn eclipse:eclipse
    

    solved my problem

    0 讨论(0)
  • 2020-12-08 04:21

    Here the steps for creating a source folder in eclipse.

    1. Right click on the project and go to properties
    2. Select "Java Build Path" from the properties dialog box
    3. Select the source tab and check that the source folders are correct if not click on the remove button to remove source folders, or the add button to add source folders.

    You can control the order in which source folders appear in a project on order and export tab on the configure build path option.

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