为什么Eclipse不识别新的JAR? [英] Why doesn't Eclipse recognize new JAR?

查看:163
本文介绍了为什么Eclipse不识别新的JAR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从队友那里收到了一个新的SOAP服务客户端JAR,我正忙着将它集成到我的应用程序中。我已将JAR放入适当的路径,覆盖以前的版本。我已经刷新了我的工作区,执行了Clean和Build,但是......



...我无法看到JAR中的任何类通过intellisense,即使我从JAR使用的代码将正确编译和执行。此外,Eclipse仍在尝试使用以前版本的JAR,因为当我执行修复导入时,它会重新导入旧类,而不是新类。



代码构建和运行,但我必须绝对引用类,而不是相对:

  org。 acmewidgets.soap.inputs.HeaderType header = new org.acmewidgets.soap.inputs.HeaderType()

而不是

  HeaderType header = new HeaderType()

以前版本的JAR不需要这个。



我如何强迫Eclipse抛弃旧的引用并使用新的?或者,Eclipse运行得很好,我的新JAR是可疑的吗?



谢谢!

解决方案

看起来好像坏了。如果再次关闭并打开项目没有帮助,请按顺序尝试:




  • 如果您的项目依赖于其他项目来自在工作区中,您最终可以在类路径中使用两个 JAR。运行测试或您的应用程序,然后切换到调试透视图,选择项目(已终止),然后从上下文菜单中选择属性。这将为您提供使用的类路径。



    将其复制到文本编辑器并搜索JAR文件,并确保在类路径中只有一个副本。 / p>


  • 在工作区中搜索JAr文件。也许还有第二个副本你不期望。


  • 创建一个新工作区(不要删除旧工作区)并导入项目。这有帮助吗?


  • 尝试最新版本的Eclipse(3.6.1)



I've received a new SOAP service client JAR from a teammate, and am busy integrating it into my app. I've put the JAR into the appropriate path, overwriting the previous version. I've refreshed my workspace, performed a Clean and a Build, but...

...I'm not able to see any of the classes within the JAR through intellisense, even though code I utilize from the JAR will compile and execute correctly. Furthermore, Eclipse is still trying to use the previous version of the JAR, in that when I perform a "fix imports", it re-imports the old classes, rather than the new ones.

The code builds and runs, but I have to reference classes absolutely, as opposed to relatively:

 org.acmewidgets.soap.inputs.HeaderType header = new org.acmewidgets.soap.inputs.HeaderType()

Instead of

 HeaderType header = new HeaderType()

The previous version of the JAR did not require this.

How do I "Force" Eclipse to ditch the old references and use the new ones? Or, is Eclipse runnin' fine, and my new JAR is suspect?

Thanks!

解决方案

Looks like something got broken for good. If closing and opening the project again doesn't help, try this in order:

  • If your project depends on other projects from the workspace, you could end up with two JARs in the classpath. Run tests or your app, then switch to the "Debug" perspective, select the project (which is terminated), then select "Properties" from the context menu. This gives you the classpath which was used.

    Copy that to the text editor and search for the JAR file and make sure you only have a single copy in the classpath.

  • Search your workspace for the JAr file. Maybe there is a second copy which you don't expect.

  • Create a new workspace (don't delete the old one, yet) and import the project. Does that help?

  • Try the latest version of Eclipse (3.6.1)

这篇关于为什么Eclipse不识别新的JAR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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