![](/img/trans.png)
[英]Eclipse: Getting error when adding external class / jar files to build path: “XYZ Cannot be resolved to a type”
[英]Adding an external jar to Order and Export build path generates error in project
我有一个eclipse插件,它具有在多个项目中构造的Java代码。 在一个项目中,我添加了一个外部jar,并使用了其中的一些类。 在编译时,没有错误报告,但是在运行时,引发了NoClassDefFoundError
异常。 我按照此解决方案解决了问题。
之后,我运行一个Project -> Clean..
,突然在另一个项目中出现一个错误,即The method filter(Predicate<? super String[]>) in the type FluentIterable<String[]> is not applicable for the arguments ...
我比较了这两种情况下的FluentIterable
用法,它们的来源没有改变。
为什么会这样呢?
我收到错误消息是因为导入的jar使用的是与guava
jar不同的FluentIterable
类。 我以为类的起源是相同的,因为当我切换回构建路径时,我没有执行Project->Clean
而eclipse仍然指向错误的类位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.