The project was not built since its build path is incomplete. Cannot find the class file for java.l

来源:互联网 发布:2017mac mini会更新吗 编辑:程序博客网 时间:2024/06/05 02:25

今天早上遇到The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build pat then try building this project The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files。我试了百度上面的很多方法,都不行。例如:

(1)

        1. 进入window / preferences / java / Installed JREs                     1)Add                     2)输入JRE Name, JDK1.5.0.09                    3)JRE home directory, 选择安装的路径                     4)OK            2. 进入Project / properties / Java Bulid Path                     1)Add library                     2)JRE System Library后按Next 。。。。结果不行。

(2)

    在Eclipse菜单的File=>New=>Project选择Android=>Android Project 这一步时,选择Create project from existing source选项,这样设置Location为你要导入Android项目的路径即可。特别是这个答案,还有好多人转载。我都想不通,你们是怎么解决的。你们应该都没有遇到过吧,遇到过就不可能转载。因为没有用。

(3)

   Either try converting the project by right-clicking, "Convert To", "Faceted Project", and select the appropriate Java EE configurations for your use case or create a new project with a Java EE nature and copy your code there.

(4)

   还有一个就是将V7包下面的V4来覆盖本工程的V4,结果还是不行。

以上的答案都不行,接下来就说说的的解决方案。这个问题的意思是:找不到Object类,找不到Object类。也就是没有把.jar包引入项目中。

详细的解决方案是:进入项目-->右键-->Properties-->Java Build Path -->Libraries -->Add Library -->JRE System Library。

就OK了。

0 1
原创粉丝点击