Monday, August 17, 2009

Eclipse build error : Cannot find the class file for java.lang.Object.

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

Seems the default JRE is not being set properly to the project that is showing this error.
All you need to do is check the JRE System Library.

Go to the project ->properties->java build path->libraries

Add Library- JRE SYSTEM LIBRARY ->Next
and now choose from the installed jre's

Alternatively you could also add the following to your classpath file :

path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.5.0_15"/>

That should solve the problem.