Build path incomplete only in some workspaces (Android)

71,855

Solution 1

This may be a little late to help you, but in case others are looking, here's how I fixed it:

Right click on your project and select ‘Properties’. Then select ‘Java Build Path’, and the Library tab. Look for a JVM. If one is not there (broken link from your copied project), click ‘Add Library’ and add the default JVM. If a VM is there, select it and hit ‘Edit’ and reselect the default JVM. This should reestablish that link and fix the problem. Hope this helps.

Solution 2

I think Bill LaPrise might be right in most cases, but not in mine. What I eventually had to do was go into the folder where I have all my projects and delete the .metadata for Eclipse (be aware that you'll have to re-import all the projects afterwards! Also all the environment settings you've set would also have to be redone)

After it was deleted I just imported the project again, and it worked.

This was on Eclipse 4.2.0 Juno, if you're wondering.

Solution 3

For those encountering this error while using Maven:

  1. Right click on the project, Build Path -> Configure Build Path...
  2. Select the libraries tab. If Maven dependencies is not in the list, you have identified the problem.
  3. Close the dialog.
  4. Right click on the project, Maven -> Disable Maven Nature
  5. Right click on the project, Configure -> Convert to Maven Project.

Solution 4

Right click on the project, Maven->Update Project Will Solve the Problem

Solution 5

Close Eclipse and run the below command from the terminal:

$ mvn clean eclipse:clean eclipse:eclipse
Share:
71,855

Related videos on Youtube

Peter Nelson
Author by

Peter Nelson

Updated on July 09, 2022

Comments

  • Peter Nelson
    Peter Nelson over 1 year

    I have multiple Eclipse (3.52 "Galileo") ) workspaces so that I can keep related projects together in the same workspace. I switch between them with File > Switch Workspace.

    I recently copied a good, working project to a different workspace, did a "File > Import" to import it in its new workspace, but after doing a Clean and Build, got the "The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project " error.

    All my other projects build fine. I thought the "build path" referred to the search path Java or SDK files, so why would it only fail on one project ( ...a project that builds fine in a different workspace, at that)?

    I've tried restarting eclipse, switching back and forth between workspaces, doing another clean and build, but no luck. Any ideas? Thanks in advance.

  • Bill LaPrise
    Bill LaPrise over 11 years
    So glad to help! I've been helped often.
  • Ajax
    Ajax about 11 years
    This was my fix for Juno as well.
  • Sajeev
    Sajeev about 6 years
    This worked for me in my Java Project - Adempiere Customization
  • asok Buzz
    asok Buzz over 5 years
    Sometimes eclipse is weird, after this try to close and reopen the project
  • micahhoover
    micahhoover almost 5 years
    This seemed to work for me, although I also had to clean afterwords (Project -> Clean ...)
  • Kurt
    Kurt over 4 years
    It was set to "Workspace default JRE" on my system and when I set it to "Execution Environment" (and chose the JDK 1.8 option) it solved the issue - thanks!

Related