在eclipse中新建java問題報錯:The type XXX cannot be resolved. It is indirectly referenced from required .class files


在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版本

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM