无法找到java.lang.Object的类文件。

[英]Cannot find the class file for java.lang.Object


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

我重新安装eclipse。然后导入Eclipse中的所有项目,但是每个项目都有一个常见错误:

Cannot find the class file for java.lang.Object. at Line 1.

无法找到java.lang.Object的类文件。在1号线。

I have checked my Java Path. But not able to sort it out.

我检查了我的Java路径。但无法解决。

9 个解决方案

#1


13  

Check this if it works:

检查一下是否有效:

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

您的java存储库有一个问题。我猜. .:

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

goto帮助>安装新的软件>点击添加按钮。

on popup:

弹出:

Name: ADT

名称:ADT

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

地点:https://dl-ssl.google.com/android/eclipse

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

安装列表中所有可用的软件。这可能的工作。

Have a good day!!!

有一个美好的一天! ! !

#2


24  

Right click on Project--> Properties, Java Build Path.

右键单击Project——>属性,Java构建路径。

enter image description here

Check whether you have JRE installed. If installed click on EDIT and check whether its pointing to correct location

检查是否安装了JRE。如果安装了,点击编辑并检查它是否指向正确的位置

enter image description here

#3


9  

A quicker way will be

一个更快的方法将会是

Right Click Project---> Properties--->Build Path--->Add External Jars--> Find your android-xx.Jar e.g android-17.jar

右键点击项目-->属性-->构建路径-->添加外部jar ->找到你的android-xx。Jar e。g android - 17. - jar

In my case I'm using the adt and it is here

在我的例子中,我使用adt,它在这里

E:\adt-bundle-windows-x86_64-20130219\adt-bundle-windows-x86_64-20130219\sdk\platforms\android-17

E:\ adt - bundle - windows - x86_64 - 20130219 \ adt - bundle - windows - x86_64 - 20130219 \ sdk \ \ android-17平台

Hope it helps

希望它能帮助

#4


4  

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).

当我试图使用eGit合并Android项目的两个分支时,我就遇到了这种情况。由于某种原因,我的构建路径基本消失了(可能其中一个文件未被跟踪)。

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).

要取回JRE和android库,我只需右键单击project explorer中的项目,然后单击android Tools -> Fix项目属性(只有安装了android ADT才能获得这些选项)。

#5


3  

Try this:

试试这个:

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

去构建路径—>库—>添加库—> JRE系统库—>选择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.

我不确定,但是您可能在您的项目中丢失了JRE系统库,这种情况并不经常发生,但是这是可能的。

#6


2  

I just had this problem and all I had to do was clean the entire workspace, i.e. all projects in the workspace. The error went away.

我刚刚遇到了这个问题,我所要做的就是清理整个工作区,也就是工作区中的所有项目。错误的走了。

#7


0  

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.

在安装了更新的谷歌ADT后,我遇到了这个问题。解决方案是,至少运行OS X,将项目复制到一个安全的位置,从Eclipse中完全删除它,然后使用File-> import ->General->现有项目重新导入到工作区。

FYI

仅供参考

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

我正在使用谷歌在OS X Mavericks Android开发者工具构建:v22.2.1-833290

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

但我几乎可以肯定,我在过去使用过以前的OSX和ADT版本。

#8


0  

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:

我也有这个问题,在我的情况下,问题是在当前项目的.classpath文件中缺少以下一行:

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

< classpathentry类型=“骗”路径= " org.eclipse.jdt.launching.JRE_CONTAINER " / >

Adding it solved the problem for me.

加上它,我就解决了这个问题。

#9


-1  

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.

这个错误是因为一个“Android私有库”被损坏或版本错误。在我的例子中,它是android-support-v4.jar。我用一个工作项目中的一个替换了它,它是有效的。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2013/04/02/3a675d42912bf7d5e7130c1c4809d7bd.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告