Eclipse 中的 Java 项目:无法解析类型 java.lang.Object.它是从所需的 .class 文件间接引用的 [英] Java project in Eclipse: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
问题描述
在 Eclipse 中导入项目后出现以下错误:
I am getting the following error after importing a project in Eclipse:
无法解析 java.lang.Object 类型.它是从所需的 .class 文件间接引用的
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
但是,我在 Eclipse Kepler 中通过 Window » Preferences » Java » Installed JREs 将路径设置为 C:Program FilesJavajdk1.6.0_41.
However, I have set the path as C:Program FilesJavajdk1.6.0_41 in Eclipse Kepler, through Window » Preferences » Java » Installed JREs.
推荐答案
这是一个令人讨厌的 Eclipse 错误,它似乎时不时地咬人.请参阅 http://dev-answers.blogspot.de/2009/06/eclipse-build-errors-javalangobject.html 寻找可能的解决方案,否则请尝试以下操作;
This is an annoying Eclipse Bug which seems to bite now and then. See http://dev-answers.blogspot.de/2009/06/eclipse-build-errors-javalangobject.html for a possible solution, otherwise try the following;
关闭项目并重新打开它.
Close the project and reopen it.
清理项目(它将重新构建构建路径,从而使用 JDK 库重新配置)
Clean the project (It will rebuild the buildpath hence reconfiguring with the JDK libraries)
或
删除并重新导入项目,如有必要,再次执行上述步骤.
Delete and Re-import the project and if necessary do the above steps again.
更好的方法是尝试使用 NetBeans 而不是 Eclipse :-)
The better cure is to try NetBeans instead of Eclipse :-)
这篇关于Eclipse 中的 Java 项目:无法解析类型 java.lang.Object.它是从所需的 .class 文件间接引用的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!