Eclipse Scala IDE - X所需的类文件丢失 [英] Eclipse Scala IDE - class file needed by X is missing
问题描述
Eclipse Scala插件有时会给我一些虚假的编译错误,指出某些类所需的类文件缺少。这可能与我的项目依赖于同一工作空间中的其他项目有关。清理项目 - 即使清理所有打开的项目 - 也不能解决这些错误。如何让他们离开?
The Eclipse Scala plugin sometimes gives me bogus compilation errors saying "class file needed by some class is missing". This may be related to the fact that my project depends on other projects in the same workspace. Cleaning the project - even cleaning all open projects - does not resolve these errors. How can I make them go away?
推荐答案
这可能是由于在类路径中有两个不同版本的同一个jar或者,我想通过在类路径中只有一个旧的二进制不兼容版本的jar)。您可以使用像JBoss Tattletale这样的类路径检查工具来检测这样的问题。
This can be caused by having two different versions of the same jar in the classpath (or, I suppose, by having just an old binary-incompatible version of a jar in the classpath). You can use a classpath checking tool like JBoss Tattletale to detect problems like this.
这里是一个用于分析项目的Tattletale命令行,其中所有jar位于 lib
子目录
Here is an example Tattletale command line for analysing a project where all the jars are in the lib
subdirectory:
java -Xmx512m -jar $HOME/opened/tattletale-1.1.2.Final/tattletale.jar $HOME/$PROJECT/lib $HOME/opened/tattletale-1.1.2.Final/reports/$PROJECT
如果Tattletale不存在,Tattletale将创建报告目录(最后一个参数)。还有Maven和Ant项目的Tattletale版本。
Tattletale will create the report directory (the last argument) if it does not already exist. There are also versions of Tattletale for Maven and Ant projects.
然后打开文件
tattletale-1.1.2.Final/reports/$PROJECT/index.html
在您的网络浏览器中,环顾四周,特别是在消除不同版本的jar文件和多个jar文件等页面上。如果没有找到该类型的问题,那些页面将为空。
in your web browser, and look around, particularly at pages like "Eliminate Jar files with different versions" and "Multiple jar files". Those pages will be empty if no problems of that type have been found.
这篇关于Eclipse Scala IDE - X所需的类文件丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!