在eclipse中新建java问题报错:The type XXX cannot be resolved. It is indirectly referenced from required .clas

Posted cocoxu1992

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在eclipse中新建java问题报错:The type XXX cannot be resolved. It is indirectly referenced from required .clas相关的知识,希望对你有一定的参考价值。

在Eclipse中遇到The type XXX cannot be resolved. It is indirectly referenced from required .class files错误.....,查找的解决办法如下:

一: 
It is indirectly referenced from required .class file

原因:你正要使用的类调用了另一个类,而这个类又调用了其他类,这种关系可能会有好多层。而在这个调用的过程中,某个类所在的包的缺失就会造成以上那个错误。

解决方法:导入缺失的包

 

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

解决方法:手动修改项目引入的jdk版本

 

以上是关于在eclipse中新建java问题报错:The type XXX cannot be resolved. It is indirectly referenced from required .clas的主要内容,如果未能解决你的问题,请参考以下文章

在eclipse中新建jsp就报错

eclipse中新建jsp文件是报错,怎么处理

关于Elipse安装报错Unfortunately the Java version needed to run Eclipse Installer couldn't be found on

关于the ONE 在eclipse上会报错:Can't start: error in configuration file(s) 批处理就没问题。

java之如何在eclipse中新建对象时自动补全

问题记录系列the resource is not on the build path of a java project