The type java.lang.Object cannot be resolved. Cannot find the class file for java.lang.Object_Android, Python及开发编程讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Android, Python及开发编程讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 2229 | 回复: 0   主题: The type java.lang.Object cannot be resolved. Cannot find the class file for java.lang.Object        下一篇 
d87025284
注册用户
等级:新兵
经验:62
发帖:59
精华:0
注册:2011-10-31
状态:离线
发送短消息息给d87025284 加好友    发送短消息息给d87025284 发消息
发表于: IP:您无权察看 2015-9-22 9:56:46 | [全部帖] [楼主帖] 楼主

在导完工程的时候报出以下错误

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

Fix the build path then try building this project

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

其中红字部分可能是别的类,比如javax.xml.*等等。

从网上查资料说是因為裝了多個版本的jre或jdk的關係。本來Eclipse在建立專案時,會自動參照你的jre路徑,但多個版本就沒辦法了。


Eclipse使用哪个JDK和你的项目使用哪个JDK是完全不同的概念..


解决办法:

eclipse菜单栏点击project----->propertys       在里面再选择Java Build Path -----> Libraries---->Add Libraries----->JRE System Library

 
右键你的项目->属性->Java构建路径->库;在这里你就可以看到你的项目所使用的JDK了.把导入时的那个JDK删除.单击右边的"添加库"按钮.选择

"JRE系统库".


...

********************************************************

a. 进入window\preferences\java\Installed JREs
        1)按Add
        2)输入JRE Name, 例JDK1.5.0.03
        3)JRE home directory, 选择安装的路径
        4)按OK
    b. 进入Project\properties\Java Bulid Path
       1)Add library
       2)选JRE System Library后按Next
       3)选workplace default JRE后按finish...

 

***************************************************

 

可以解决问题





--转自



赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论