來(lái)自: i have only belief--wjw
在Eclipse中遇到The type XXX cannot be resolved. It is indirectly referenced from required .class files錯(cuò)誤.....,查找的解決辦法如下:
一:
It is indirectly referenced from required .class file原因:你正要使用的類調(diào)用了另一個(gè)類,而這個(gè)類又調(diào)用了其他類,這種關(guān)系可能會(huì)有好多層。而在這個(gè)調(diào)用的過(guò)程中,某個(gè)類所在的包的缺失就會(huì)造成以上那個(gè)錯(cuò)誤。
解決方法:導(dǎo)入缺失的包
二:
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
出現(xiàn)以上訊息的原因是因?yàn)槟阊b了多個(gè)版本的jre或jdk的關(guān)係。本來(lái)Eclipse在建立專案時(shí),會(huì)自動(dòng)參照你的jre路徑,但多個(gè)版本就沒(méi)辦法了。
你只能手動(dòng)建立…
1. 進(jìn)入window\preferences\java\Installed JREs
1)按Add
2)輸入JRE Name, 例JDK1.5.0.03
3)JRE home directory, 選擇安裝的路徑
4)按OK
2. 進(jìn)入Project\properties\Java Bulid Path
1)Add library
2)選JRE System Library後按Next
3)選workplace default JRE後按finish...