29 December 2005

Resolving spurious project errors in Eclipse

Opening a workspace with several projects, I was presented with the following error for two of the projects:

The project cannot be built until the build path errors are resolved.

The resolution was to force a resave of the selected projects (and their .classpath files):

  1. Open the project properties
  2. Select Java Build Path > Libraries
  3. Add a new, arbitrary library (to be deleted later) > OK
  4. Wait for the workspace to refresh (or force a refresh of the project)
  5. The error(s) will go away
  6. Remove the dummy library

The only other references I could find were to make minor alterations of contents of the .classpath file.

[ posted by sstrader on 29 December 2005 at 11:41:28 PM in Programming ]

Thank you so much!

Posted by: Craig at April 14, 2010 4:46 AM


Posted by: Teguh at April 19, 2010 11:06 PM

This has fixed the problem for me, but whenever I clean the project, I have to repeat this. Also I notice that the original post was 2005 and someone has replied a few weeks ago (2010). I'm new to Eclipse and I hope the real reason for this is because I don't yet understand how to configure my android app properly. If this is a problem with Eclipse, is it ever going to be fixed?

Posted by: Philip Beck at May 2, 2010 6:29 AM

This isn't an issue with Eclipse (I don't think) but probably an issue with file visibility or network paths within the project. I rarely encounter this any more, and it's usually because of a missing jar or somesuch change in source control. I.e. if someone else adds a library reference in a class but doesn't add the jar to the classpath.

Check in Project > Properties > Java Build Path > Libraries, to start with.

Posted by: sstrader at May 2, 2010 2:10 PM

Thank you!

Posted by: Fernando at May 26, 2010 1:46 AM

Thanks a lot, it works very well

Posted by: Sam at June 8, 2010 7:06 PM

So, 5 years later.....this still hasn't been fixed?!?!? :))

Posted by: Kuz'ma at June 22, 2010 5:48 PM

Fantastic. Worked a treat.

Posted by: hippy at July 10, 2010 6:44 PM

Hey, good call on that nice tip; thank you.

Posted by: Clay at July 14, 2010 11:08 PM

Thanks for pointing that out, I just started my learning and this error really annoyed me, Thanks http://abtevrythng.blogspot.com/

Posted by: heartrobber18 at July 30, 2010 1:49 PM

Thank you for posting your solution!

Posted by: Gay at August 8, 2010 8:39 AM

This problem also seems to happen when the gen folder gets deleted during a clean. Manually adding the gen folder to your project so that it always exists seems to fix the problem when doing a clean.

Posted by: shawn at August 24, 2010 6:50 AM

So good, thank you.

as said by Kuz'ma, this hasn't been solved for 5 years !?!?!?

Posted by: paimpol at August 29, 2010 11:31 AM

gud idea.

Posted by: senthil ,urugan at September 2, 2010 10:21 PM

I can not resolve it, why?

Posted by: iDan at October 14, 2010 7:46 AM

Thank you very very very much!!!! the only solution for this problem on all the internet!!

Posted by: Carlos at November 4, 2010 4:01 PM

Thanks a bunch, you made my day :)

Posted by: Don at January 3, 2011 9:10 AM

Thank you so much, saved me a lot of time!

Posted by: Francesco LMU Monaco at January 13, 2011 12:33 PM

Brilliant - thanks!

Posted by: Jamie Lemon at May 19, 2011 12:07 PM

Thanks for sharing this :o)
It was kind of driving me crazy...

Posted by: Eric at May 31, 2011 2:05 AM

This fixed my problem! Thanks for that! :)

Posted by: John at June 21, 2011 3:51 AM

Excellent fix ... just added the JUnit library to the projects and we're golden. I'm looking forward to see how long it maintains itself.

Posted by: Dirck at June 26, 2011 6:31 PM

Thank you! Saved me from losing the rest of my hair!!

Posted by: John at April 17, 2012 12:44 PM

Still works in 2014!

Posted by: Agnieszka at May 1, 2014 2:22 AM

Worked for me - 9 years after the first post! Thanks!

Posted by: mediawhapper at May 20, 2014 4:46 PM

Still nothing

Posted by: Mohamed at May 21, 2014 5:55 AM


Posted by: Hiya at September 4, 2014 3:05 AM

If you download all your missing libraries at this site http://jar-download.com/index.php you will have no problems any more

Posted by: Gerd at June 11, 2015 12:07 PM

It works also with eclipse 2015! thanks

Posted by: enry at August 25, 2015 5:26 AM

Thanks... so useful for me

Posted by: pallavi at June 1, 2016 3:34 AM
Post a comment

Remember personal info?