Sunday, June 04, 2006

Eclipse error: The type java.lang.Object cannot be resolved. It is indirectly referenced from the required .class files

This error popped up the other day when I was copying projects from an old workspace into a new, clean Eclipse workspace. It turned out that the reason the base class java.lang.Object could not be found is because the new workspace did not have Eclipse variables set, and they were referenced by the project in the old workspace. So in the project properties Build Path JRE path. Once I created the Eclipse classpath variables and rebuilt the project, the errors went away.

8 Comments:

At 7:55 PM, Anonymous Anonymous said...

I get this all the time checking out projects from cvs. any change to .classpath or .project helps?

 
At 5:25 PM, Blogger massachusetts said...

You need to change the .classpath file to point to correct J2EE container path.

 
At 2:24 AM, Anonymous Anonymous said...

Add rt.jar to the Build Path, it will work.

 
At 4:06 PM, Blogger Kishore On th Blog said...

Yes.Added rt.jar and It worked..Thanks dude.

 
At 7:56 AM, Anonymous Anonymous said...

any idea how to resolve this error in unix environment while building eclipse.
Thanks

 
At 3:47 AM, Anonymous Anonymous said...

Thanks. I was struggling but with your post it went like rocket when i added rt.jar.



Imran

 
At 12:34 PM, Anonymous Anonymous said...

Man, u king who is not a singh
This certainly helped me, this eclipse sucks, but in intelliJ we have no such problems

 
At 8:46 AM, Anonymous Anonymous said...

Thanks! Adding rt.jar resolved my issue.

 

Post a Comment

<< Home