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

前端 未结 24 2904
故里飘歌
故里飘歌 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:06

    What I did to make one of my projects to check out properly is by

    1) Import your project from svn

          file-->import-->SVN-Checkout Projects From SVN
    

    2) Find your Project and then in the "Check Out As" dialogue make sure you have the radio button selected "Check out as a project configured using the New Project Wizard"

    3) Go through regular steps.

    The wizard pulls the project properly and then setups your eclipse....

    without using the wizard I find that all hell breaks loose.....

    Hope this helps...

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

    You may want to try running eclipse with the -clean startup option - it tries re-building eclipse's metadata of the workspace.

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

    I have this issue from time-to-time and often it's because the project wasn't marked as a java project. You can change this by going to the properties for the project > Project Facets > and selecting java. You may then need to properly configure that project, but this is probably part of the problem

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

    What worked for me was copping the .settings/ directory from another project.

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

    Did you have your .project file in your folders?

    I got the same problem. Than i realized that I didn't have the .project file.

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

    For example if there are 4 project and a root project, add the other child projects to build path of root project. If there is not selection of build path, add below codes to .project file.

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
        <name>rootProject</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
            <buildCommand>
                <name>org.eclipse.jdt.core.javabuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
            <buildCommand>
                <name>org.eclipse.m2e.core.maven2Builder</name>
                <arguments>
                </arguments>
            </buildCommand>
        </buildSpec>
        <natures>
            <nature>org.eclipse.jdt.core.javanature</nature>
            <nature>org.eclipse.m2e.core.maven2Nature</nature>
        </natures>
    </projectDescription>
    
    0 讨论(0)
提交回复
热议问题