java.lang.Object cannot be resolved in Eclipse

后端 未结 18 2152
青春惊慌失措
青春惊慌失措 2020-12-13 09:12

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

相关标签:
18条回答
  • 2020-12-13 09:46

    I had the same issue after moving from JRE7 to JDK7. Finally I had to remove the JRE7 configuration from the Eclipse preferences and then add the following two lines to the eclipse.ini file.

    -vm C:\Program Files\Java\jdk1.7.0_55\bin\javaw.exe

    0 讨论(0)
  • 2020-12-13 09:51

    After updating my Android SDK to make Appcelerator Titanium happy, I started getting "java.lang.Object cannot be resolved" for my Android projects in (non-Titanium) Eclipse.

    I updated all dependencies in Eclipse, and the error healed after a restart of Eclipse.

    0 讨论(0)
  • 2020-12-13 09:55

    I had this problem moving a Maven project from Eclipse to RAD. I had a JSP file that worked in Tomcat and JBoss, but threw a NullPointerException in WebSphere on the form definition during the compile.

    Anyway, after transforming the Maven project into an Ant project (mvn ant:ant), I imported the Ant project into RAD and got this error. The fix:

    1. Open the Java Build Path, selecting the Libraries tab.
    2. Find the JRE System Library and remove it.
    3. Add the JRE System Library.

    Goofy, but it works. It must reset some property in a file. I don't know if the problem is the older version of Eclipse or RAD.

    0 讨论(0)
  • 2020-12-13 09:55

    I had that error almost every time I launched Eclipse for the first time; if I close and then re-open Eclipse, the error is gone.

    I found this solution useful, though (I've copied here to protect the link, credit goes to the original author):

    1. In Eclipse go to Windows -> Preferences -> Java -> Installed JREs.
    2. Select the currently active JRE/JDK and press the Edit button.
    3. Select the rt.jar and change its position in the list of JRE system libraries (e.g. press the Up button once).
    4. Confirm all changes, clean and rebuild the workspace.
    5. The next time you face the problem reposition the rt.jar again (or reset the order by pressing the Restore Default button).
    0 讨论(0)
  • 2020-12-13 09:55

    I just had to restart eclipse, and the error went away. Strange.

    0 讨论(0)
  • 2020-12-13 09:56

    please select your installed system jre version from java build path.

    0 讨论(0)
提交回复
热议问题