打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Object cannot be resolved解决方法
The type java.lang.Object cannot be resolved. Cannot find the class file for java.lang.Object
 

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

 

电脑上安装了多个版本的jdk

 

Eclipse使用哪个JDK和你的项目使用哪个JDK是完全不同的概念..
右键你的项目->属性->Java构建路径->库;在这里你就可以看到你的项目所使用的JDK了.把导入时的那个JDK删除.单击右边的"添加库"按钮.选择"JRE系统库".

 

eclipse为什么出现the type java.lang.Object cannot be resolved

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

出現以上訊息的原因是因為你裝了多個版本的jre或jdk的關係。本來Eclipse在建立專案時,會自動參照你的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...

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

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
解决myeclipse5.1GA上的破烂事
"XX cannot be resolved to a type "eclipse报错及解决说明
eclipse j2ee导入myeclipse后报错的解决
JDK,JRE,J2SDK,eclipse SDK之间的关系
精简出最小JRE 再转
Win8.1 中 配置JDK + Eclipse
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服