Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build path incomplete only in some workspaces (Android)

Tags:

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.

like image 216
Peter Nelson Avatar asked Mar 28 '11 04:03

Peter Nelson


Video Answer


2 Answers

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.

like image 165
Bill LaPrise Avatar answered Nov 25 '22 13:11

Bill LaPrise


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.

like image 44
ringkjob Avatar answered Nov 25 '22 15:11

ringkjob