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

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


当前回答

快速而简单地我用这种方式修复了它(我使用ADT版本:v21.0.0-531062在Windows XP家庭版)

Opened manifest file. Changed the Existing project minSdkVersion to the same value as maxSdkVersion ( advise: it may be good to create a New project and see what is it's maxSdkVersion ) Save manifest file. Right Click the project and select Build Project. From top menu: Project - Clean.. - check Only the relevant project, below I checked Start a build immediately and Build only the selected projects and OK. open the java file - NO red errors anymore ! Back to step 1 above and changing Back minSdkVersion to it's Original value (to supoprt as many Android version as possible).

这很有效,但每隔几天问题就会复发。我做同样的事情,它解决了问题,让我发展。

其他回答

在我的例子中,这是因为我在pom.xml文件中添加了一个新的依赖项。

新的依赖项依赖于旧版本的库(2.5)。我的pom.xml中的另一个库需要相同的库,但它需要3.0版本。

出于某种原因,当Maven遇到这些冲突时,它会简单地忽略最新的版本。在Eclipse中查看pom.xml时,您可以选择底部的“依赖层次结构”选项卡,以查看依赖关系是如何解析的。在这里,您将发现是否因为这个原因而忽略了所讨论的库(以及类)。

在我的例子中,这就像锁定新版本一样简单。您可以通过右键单击该条目来做到这一点—在上下文菜单中有一个选项可以将其锁定。

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

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

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

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

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

如果你的代码是正确的,这是最肯定的情况,但通过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

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

如果您的设置仍然没有发现任何错误,您可以尝试Project -> Clean并清理工作区中的所有项目。

编辑:抱歉,没有看到verbose_mode的建议…同样的事情

我有时会遇到这种情况,我总是用“mvn eclipse:clean”命令来清理旧的属性,然后运行mvn eclipse:eclipse -Dwtpversion=2.0(当然对于web项目)。这里保存了一些旧的属性,所以eclipse有时会感到困惑。