将外部jar添加到Order and Export构建路径会在项目中生成错误 [英] Adding an external jar to Order and Export build path generates error in project

查看:199
本文介绍了将外部jar添加到Order and Export构建路径会在项目中生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个eclipse插件,它具有在多个项目中构建的Java代码。在一个项目中,我添加了一个外部jar,并使用了其中的一些类。在编译时,没有报告错误,但是在运行时,抛出了 NoClassDefFoundError 异常。我已解决解决方案。

I have an eclipse plugin which has it's Java code structured in multiple projects. In one of the projects I added an external jar and used some classes from it. At compilation time no errors where reported, but at runtime, a NoClassDefFoundError exception was thrown. I fixed the problem following this solution.

此后,我运行 Project->干净。并突然在另一个项目中出现一个错误,该错误是 FluentIterable< String类型的方法filter(Predicate< ;? super String []>) []>不适用于参数...

After this I run a Project -> Clean.. and out of a sudden in a different project I have an error that The method filter(Predicate<? super String[]>) in the type FluentIterable<String[]> is not applicable for the arguments ....

我比较了两种情况下的 FluentIterable 情况,它们的来源都没有改变。

I compared the FluentIterable clasess in both situations and their origin does not modify.

为什么会这样?

推荐答案

我遇到了错误,因为导入的jar使用的是其他 FluentIterable 来自番石榴 jar的类。我认为类的来源是相同的,因为当我切换回构建路径时,我没有执行 Project-> Clean 并且eclipse仍指向错误的类位置

I was getting the error because the imported jar was using a different FluentIterable class from a guava jar. I thought the class origin is the same because when I switched back the build path, I did not execute a Project->Clean and eclipse was still pointing to the bad class location.

这篇关于将外部jar添加到Order and Export构建路径会在项目中生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆