杂-The type java.lang.Object cannot be resolved It is indirectly referenced ...

Posted gavanwanggw

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了杂-The type java.lang.Object cannot be resolved It is indirectly referenced ...相关的知识,希望对你有一定的参考价值。

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

当你在Eclipse引用不同版本号JDKproject时会发生该问题。因为你开发环境中应用了多个版本号的JDK 或JRE导致的。Eclipse会依照最初的开发环境默认选择相应的Jre。如Eclipse上有jdk1.4开发的环境project,当你在引入高版本号jdk1.6开发的project时,以上问题就出现了。


问题解决的方案例如以下

(1)

进入window\preferences\java\Installed JREs 
按Add --> Browse...--->选择jre安装路劲(我的jre路径是D:\Program Files\Java\jre1.6.0_02)--->OK
找到你的project右键点击Properties选项 出现对话框后 选择右边的Libraries选项卡 ---> 单击Add 了Library...--->

选择Jre System Library... ---> Next--->选择Alternate Jre 下的相应版本号jre --> Finish ---> Ok

以上问题就可解决。


(2)若是还是不行。那就把jdk改为1.6或者1.7吧







以上是关于杂-The type java.lang.Object cannot be resolved It is indirectly referenced ...的主要内容,如果未能解决你的问题,请参考以下文章

The method getContextPath() from the type HttpServletRequest refers to the missing type

The method queryForMap(String, Object...) from the type JdbcTemplate refers to the missing type Data

[WPF]The type name ‘App’ does not exist in the type '...'的问题

The method xx from the type xx refers to the missing type List等问题的解决办法

Array types are now written with the brackets around the element type问题的解决方法

返回suggester的类型(Returning the type of the suggester)