我在Eclipse中出现了一个错误。这个错误信息是什么意思:
无法解析iglu.ir.TermVector类型。它是从必需的.class文件中间接引用的
我在Eclipse中出现了一个错误。这个错误信息是什么意思:
无法解析iglu.ir.TermVector类型。它是从必需的.class文件中间接引用的
当前回答
我有这个错误,因为一个损坏的本地maven存储库。
因此,为了解决这个问题,我所要做的就是进入我的存储库,删除有关.jar所在的文件夹,然后在Eclipse中强制执行更新maven。
其他回答
除了前面提到的类文件丢失的原因之外,此错误还可以指示存在重复的类文件,当构建路径上的类文件使用另一个在构建路径中具有多个定义的类时,eclipse将报告此错误。
我得到的错误,当我只是改变一些svn设置,而不是在代码中的任何东西。只是清理项目修复了错误。
听起来这是一个已知的问题(Bug 67414),在3.0已经解决了……有人评论说他们在3.4中也会遇到这种情况。
与此同时,解决方法是从项目中删除JRE系统库,然后再将其添加回来。以下是步骤:
Go to properties of project with the build error (right click > Properties) View the "Libraries" tab in the "Build Path" section Find the "JRE System Library" in the list (if this is missing then this error message is not an eclipse bug but a mis-configured project) Remove the "JRE System Library" Hit "Add Library ...", Select "JRE System Library" and add the appropriate JRE for the project (eg. 'Workspace default JRE') Hit "Finish" in the library selection and "OK" in the project properties and then wait for the re-build of the project
希望这个错误能得到解决。
我有时会遇到这种情况,我总是用“mvn eclipse:clean”命令来清理旧的属性,然后运行mvn eclipse:eclipse -Dwtpversion=2.0(当然对于web项目)。这里保存了一些旧的属性,所以eclipse有时会感到困惑。
我在Eclipse 4.4.2中遇到过一个有趣的案例。我的项目(P1)引用了一个外部类(项目P2),它有两个同名但参数类型不同的方法:
public static void setItem(Integer id) …
public static void setItem(Item item) …
类型Item包含在第三个项目P3中,我不想在这里看到它。P1只调用了第一个方法:
ExternalClass.setItem(Integer.valueOf(12345));
因此,使用Item类的第二个方法没有被使用,而且P3确实不在编译类路径中——如果没有被使用,为什么要使用它呢?
Eclipse告诉我
The type ...Item cannot be resolved.
It is indirectly referenced from required .class files
从命令行编译不会产生任何此类问题。更改第二个方法的名称(此处未使用!)也使这个问题在Eclipse中消失了。