The type java.lang.Object cannot be resolved. Cannot find the class file for java.lang.Object
eclipse菜單欄點(diǎn)擊project----->propertys 在里面再選擇Java Build Path -----> Libraries---->Add Libraries----->JRE System Library 電腦上安裝了多個(gè)版本的jdk Eclipse使用哪個(gè)JDK和你的項目使用哪個(gè)JDK是完全不同的概念.. 右鍵你的項目->屬性->Java構建路徑->庫;在這里你就可以看到你的項目所使用的JDK了.把導入時(shí)的那個(gè)JDK刪除.單擊右邊的"添加庫"按鈕.選擇"JRE系統庫".
eclipse為什么出現the type java.lang.Object cannot be resolved
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
出現以上訊息的原因是因為你裝了多個(gè)版本的jre或jdk的關(guān)係。本來(lái)Eclipse在建立專(zhuān)案時(shí),會(huì )自動(dòng)參照你的jre路徑,但多個(gè)版本就沒(méi)辦法了。 ... ******************************************************** a. 進(jìn)入window\preferences\java\Installed JREs 1)按Add 2)輸入JRE Name, 例JDK1.5.0.03 3)JRE home directory, 選擇安裝的路徑 4)按OK b. 進(jìn)入Project\properties\Java Bulid Path 1)Add library 2)選JRE System Library后按Next 3)選workplace default JRE后按finish... *************************************************** |
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請
點(diǎn)擊舉報。