在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的關係。本來Eclipse在建立專案時,會自動參照你的jre路徑,但多個版本就沒辦法了。 
你只能手動建立… 
1. 進入window\preferences\java\Installed JREs 
1)按Add 
2)輸入JRE Name, 例JDK1.5.0.03 
3)JRE home directory, 選擇安裝的路徑 
4)按OK 
2. 進入Project\properties\Java Bulid Path 
1)Add library 
2)選JRE System Library後按Next 
3)選workplace default JRE後按finish...

 
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()