Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.Object cannot be resolved in Eclipse

When I installed the latest installment in Mac OSX - the Mountain Lion - I experienced some problems getting Eclipse to work I also lost most of my Android developer files (but I still have my projects). I suspect this is due to the choice of removing the /Developer and move the XCode and other Apple developer tools (I placed my Android tools here).

I have now installed the latest version of Eclipse and the problem still seems to be around. There are errors in all my projects and I get an error message prompting:

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

I tried to check the Java class-path both in Eclipse and in my terminal and these seems to be OK. java and javac both run in my terminal and there is a valid path to the java source files in Eclipse (Under Preferences, Java, Installed JREs). That being said I'm not an expert in Eclipse so there may be that I have misunderstood how this problem ought to be solved. Anyone here with similar problems or who know the cure?

like image 843
olovholm Avatar asked Aug 22 '12 12:08

olovholm


People also ask

How do I clean my Eclipse project?

1. To clean projects in Eclipse IDE: Go to Menu option –> Select Project –> click Clean… Note: The same can also be achieved by clicking CTRL + S (save) simultaneously in Eclipse IDE.

How do I open build path in eclipse?

In Eclipse select the web project and right-click Build Path > Configure Build Path. This will display the Java Build Path window.


1 Answers

Make sure that you have a valid JRE or JDK defined in the Java Build Path of your project. Right-click on your project, select Properties... and then Java Build Path.

like image 163
Dan D. Avatar answered Oct 05 '22 15:10

Dan D.