我在Eclipse中出现了一个错误。这个错误信息是什么意思:

无法解析iglu.ir.TermVector类型。它是从必需的.class文件中间接引用的


当前回答

当jar文件中的类不遵循与jar文件夹结构相同的结构时,就会发生此错误。

例如,如果你的类文件包含包com.test.exam,并且从这个类文件创建的classes.jar包含结构test.exam…将抛出错误。您需要纠正classes.jar的包结构,然后将其包含在eclipse构建路径中…

其他回答

对我来说,当我使用已经使用了很长时间的旧jar集将jdk升级到1.8.0_60时,就会发生这种情况。如果我回到jdk1.7.0_25,所有这些问题都消失了。这似乎是JRE和库之间的兼容性问题。

In my case ,I created a project and made its minSdkVersion=9 and targetSdkVersion=17. I used automatically generated libs/android-support-v4.jar. I also had to make use of ActionBarActivity using android-support-v7-appcomapt.jar. So I just copied the android-support-v7-appcompat.jar file from android-sdk/extras/andrid/support/v7/appcompat/libs folder and pasted it to my project libs folder. And this caused the above error. So basically,I needed to put android-support-v4.jar file from android-sdk/extras/andrid/support/v7/appcompat/libs as well to my project libs folder. As per my knowledge the v7.jar file had dependencies on v4.jar file. So ,it needed it own v4.jarfile,instead of my project,automatically created v4.jar file.

除了前面提到的类文件丢失的原因之外,此错误还可以指示存在重复的类文件,当构建路径上的类文件使用另一个在构建路径中具有多个定义的类时,eclipse将报告此错误。

既然你给我们的细节很少,很可能你所做的,这是一个非常容易犯的错误,而不是去

生成路径>配置生成路径>项目

然后从那里添加额外的项目文件夹,而不是

生成路径>配置生成路径>库

然后从那里添加你的项目文件夹。

如果你的代码是正确的,这是最肯定的情况,但通过ctrl+空格快捷键自动重新组织导入,而不是你的导入语句引用com.your。Additionalproject,你的引用都指向bin.com.your.additionalproject。

注意这个箱子。这意味着你通过将你的其他项目文件夹结构作为一个库来间接引用你的类,让你的IDE做所有的工作来查找你所引用的二进制类。

要纠正这一点,请从Libraries中删除该文件夹,并将其添加到Projects选项卡下,并重新组织导入。您的项目应该可以正常工作。

听起来这是一个已知的问题(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

希望这个错误能得到解决。