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:
I get this all the time checking out projects from cvs. any change to .classpath or .project helps?
You need to change the .classpath file to point to correct J2EE container path.
Add rt.jar to the Build Path, it will work.
Yes.Added rt.jar and It worked..Thanks dude.
any idea how to resolve this error in unix environment while building eclipse.
Thanks
Thanks. I was struggling but with your post it went like rocket when i added rt.jar.
Imran
Man, u king who is not a singh
This certainly helped me, this eclipse sucks, but in intelliJ we have no such problems
Thanks! Adding rt.jar resolved my issue.
Post a Comment
<< Home