Skip to content
Advertisement

My copy of Eclipse doesn’t know what an object or a String is

I have a copy of Eclipse Indigo on my mac. It was working fine until I imported a project I had made on a different computer. Now I get errors like “The type java.lang.Object cannot be resolved.” and “String cannot be resolved to a type”.

Also, the computer I built it on had Java 7, while my slightly broken mac has Java 6, and won’t update. I’m not sure, but I suspect this may be an issue.

What happened, and how do I fix it?

UPDATE

I put what I think is the right JRE in the build path, but now when I run it, I get these errors:

JavaScript

Advertisement

Answer

Verify if you have a Runtime Enviroment in your build path.

Object and String are at least in a JRE and the JRE must be referenced in the build path.

If you create a new java project you’ll find there by default, but it’s there.

The project build path can be broken by moving the JRE or JDK, changing the JAVA_HOME environment variable or by misconfiguration of custom System libraries that refer to specific JREs.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement