The type java.lang.Object cannot be resolved
生活随笔
收集整理的這篇文章主要介紹了
The type java.lang.Object cannot be resolved
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
java常見異常
@(JAVA)[java]
1、The type java.lang.Object cannot be resolved
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
當你在Eclipse引用不同版本JDK工程時會發生該問題。由于你開發環境中應用了多個版本的JDK 或JRE導致的。Eclipse會按照最初的開發環境默認選擇對應的Jre。如Eclipse上有jdk1.4開發的環境工程,當你在引入高版本jdk1.6開發的工程時,以上問題就出現了。
問題解決的方案如下:
進入window\preferences\java\Installed JREs
按Add –> Browse…—>選擇jre安裝路勁(我的jre路徑是D:\Program Files\Java\jre1.6.0_02)—>OK
找到你的工程右鍵點擊Properties選項 出現對話框后 選擇右邊的Libraries選項卡 —> 單擊Add 了Library…—>
選擇Jre System Library… —> Next—>選擇Alternate Jre 下的對應版本jre –> Finish —> Ok
以上問題就可解決。
總結
以上是生活随笔為你收集整理的The type java.lang.Object cannot be resolved的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: String, StringBuilde
- 下一篇: JDBC之二:DAO模式