0

My eclipse does not show the 'Java Build Path' option in a JAVA project's properties -- despite the fact that I took care to add the builder to the project.

This is my project's properties screenshot (on the left side side, there should be an option for Java Build Path):

enter image description here

Why is this and how can I fix it?

BTW, the project builds just fine when I type ant run.

Eclipse version is Indigo (3.7) SR2.


In reply to the 1st comment below, the .project files shows:

<natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
</natures>

In reply to the 2nd comment below, the .project contents of the "top level folder" is:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>MyInheritedCrab</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
            <triggers>full,incremental,</triggers>
            <arguments>
                <dictionary>
                    <key>LaunchConfigHandle</key>
                    <value>&lt;project&gt;/.externalToolBuilders/MyInheritedCrab build.xml [Builder].launch</value>
                </dictionary>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
    </natures>
</projectDescription>
Community
  • 1
  • 1
Withheld
  • 4,603
  • 10
  • 45
  • 76
  • 1
    That does not look like a Java project, there would be several 'Java xxxx' items if it were. To see exactly what type of project it is look at the '" list in the '.project' file – greg-449 Oct 21 '14 at 15:13
  • @greg-449 Thanks for the `` tip. I looked at my .project file and observed that the natures element is empty: ` `. What should I put there? – Withheld Oct 21 '14 at 15:16
  • @greg-449 Oops... sorry, I was looking at a folder one level above. This particular project's `.project` shows: ` org.eclipse.jdt.core.javanature ` – Withheld Oct 21 '14 at 15:18
  • 1
    What do mean by one level up? Projects must be at the top level of the workspace, they can't be nested – greg-449 Oct 21 '14 at 15:20
  • This is something I inherited, checked out from SVN, it is structured into multiple projects (each in own sub-folder), each having its own `.project`, but the top level directory has a `.project` file as well. Is this a problem? I just posted the content of that "top level project". – Withheld Oct 21 '14 at 15:24
  • 1
    Yes it is. You must check them out separately all at the top level. – greg-449 Oct 21 '14 at 15:29
  • Wow! I didn't know that I cannot check all projects under a common folder. How did that top level `.project` file got created? It's not in SVN. Eclipse must have done it. – Withheld Oct 21 '14 at 15:32
  • @greg-449 Thank you! That solved the problem. Please post as an answer, so that I can accept it and perhaps help another poor soul not aware of this subtlety. – Withheld Oct 21 '14 at 16:28

1 Answers1

1

When checking code out from SVN (or any other source control system) you must make sure that Eclipse projects are checked out at the top level of the workspace. Projects nested in folders will not be recognized as projects by Eclipse.

Eclipse projects always have a .project file in the project folder (but files starting with a '.' are sometimes hidden by file browsers).

greg-449
  • 109,219
  • 232
  • 102
  • 145