Myeclipse遇到The type XXX cannot be resolved.的问题

文章详细介绍了在使用Eclipse导入工程到MyEclipse时遇到ThetypeXXXcannotberesolved错误的解决方案。通过导入缺失的jar包和手动设置JRE版本来解决兼容性问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

刚才从eclipse中将工程文件导入Myeclipse的时候,报错The type XXX cannot be resolved. It is indirectly referenced from required .class files错误,出现这个错误一般有两个问题:
一: 
It is indirectly referenced from required .class file

原因:你正要使用的类调用了另一个类,而这个类又调用了其他类。而在这个调用的过程中,某个类所在的包的缺失就会引起以上那个错误。

解决方法:导入缺失的jar包

二:
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

 

出现这个问题的原因是Eclipse安装了多个版本的jre或者jdk,我出现这个问题的原因是我之前的项目再eclispe上面jre的版本是1.7,而导入的Myecilpse的版本是1.6,jre版本不同。

手动add 1.7版本的jre。
1. window\preferences\java\Installed JREs 
    Add--> JRE Name, 例JDK1.7.0 JRE -->home directory, 选择安装的路径-->OK 

2. 进入Project\properties\Java Bulid Path 
   Add library --> JRE System Library-->workplace default JRE选择刚才安装的jre

  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值