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

查看:837
本文介绍了Eclipse中的Java项目:无法解析java.lang.Object类型。它是从所需的.class文件间接引用的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中导入项目后,我收到以下错误:


类型java.lang.Object无法解析。它被间接引用来自所需的.class文件


但是,我将路径设置为 C:\Program Files\\ \\ Kava \jdk1.6.0_41 在Eclipse Kepler中,通过菜单»窗口»首选项»Java»已安装的JRE

解决方案

这是一个令人讨厌的Eclipse Bug,似乎现在咬住了。请参阅 http://dev-answers.blogspot.de/2009/06/eclipse -build-errors-javalangobject.html ,否则请尝试以下操作:




  • 关闭项目并重新打开

  • 清理项目(将重建构建路径,从而使用JDK库重新配置)



    OR


  • 删除并重新导入项目,如有必要,请再次执行上述步骤。




更好的治疗方法是尝试NetBeans而不是Eclipse: - )


I am getting the following error after importing a project in Eclipse:

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

However, I have set the path as C:\Program Files\Java\jdk1.6.0_41 in Eclipse Kepler, through Menu » Window » Preferences » Java » Installed JREs.

解决方案

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.
  • Clean the project (It will rebuild the buildpath hence reconfiguring with the JDK libraries)

    OR

  • Delete and Re-import the project and if necessary do the above steps again.

The better cure is to try NetBeans instead of Eclipse :-)

这篇关于Eclipse中的Java项目:无法解析java.lang.Object类型。它是从所需的.class文件间接引用的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆