---
# System prepended metadata

title: java.lang import失敗
tags: [開發問題]

---

使用IDE為 Eclipse

當專案有引入JDK時，java.lang物件仍然無法引入專案中
![1708418796349](https://hackmd.io/_uploads/BJnJraU2a.jpg)

解決方式是重新引入JRE
1. Right-click on project » Properties » Java Build Path
2. Select Libraries tab
3. Find the JRE System Library and remove it
4. Click Add Library... button at right side » Add the JRE System Library (Workspace default JRE)

根據網路上的資料來看這個錯誤的發生原因是Eclipse的bug引起的

參考
https://stackoverflow.com/questions/18075343/java-project-in-eclipse-the-type-java-lang-object-cannot-be-resolved-it-is-ind


