Cannot find the class file for java.lang.Object

前端 未结 9 1369
醉梦人生
醉梦人生 2021-02-12 16:31

I reinstalled my eclipse. and then imported all the projects in the Eclipse, but every project has a common error:

Cannot find the class file for java.lang.Object.

相关标签:
9条回答
  • 2021-02-12 16:54

    Check this if it works:

    There is a problem with your java repositories. I guess..:

    goto Help>Install New Software> Click on Add Button .

    on popup:

    Name: ADT

    Location:https://dl-ssl.google.com/android/eclipse

    Install all the available softwares in the list. This may work.

    Have a good day!!!

    0 讨论(0)
  • 2021-02-12 16:58

    This happened to me when I tried to merge two branches of an Android project using eGit. For some reason my build path basically disappeared (possibly one of the files was untracked).

    To get the JRE and android libraries back, I just right-clicked on the project in the project explorer, and hit Android Tools -> Fix Project Properties (these options are only available if you have Android ADT installed).

    0 讨论(0)
  • 2021-02-12 17:10

    I had this issue too and in my case the issue was that the following line was missing from the .classpath file of the current project:

    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>

    Adding it solved the problem for me.

    0 讨论(0)
  • 2021-02-12 17:10

    Try this:

    Go to Build Path -> Libraries -> Add Library -> JRE System Library -> Select JRE

    I am not sure but you might be missing JRE System Library in your project, this does not happen often but it is possible.

    0 讨论(0)
  • 2021-02-12 17:11

    I've had this problem after installing a newer version of Google ADT. The solution, at least running OS X, is to make a copy of your project to a safe location, delete it completely from Eclipse and then import it again using File->Import->General->Existing Projects into Workspace.

    FYI

    I am Using Google's on OS X Mavericks Android Developer Tools Build: v22.2.1-833290

    but I am almost sure I have done in the past with previous OSX and ADT versions.

    0 讨论(0)
  • 2021-02-12 17:13

    This error is because one of "Android Private Libraries" is either corrupted or of wrong version. In my case it was android-support-v4.jar. I replaced it with one from a working project and it works.

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