简体   繁体   English

Eclipse jar在项目类路径上发生冲突

[英]Eclipse jar conflicted on project classpath

I am using eclipse with the GWT SDK. 我在GWT SDK中使用eclipse。 Within my project I use Httpclient and within the GWT SDK they also use an older version of HttpClient which is missing a method I use. 在我的项目中,我使用Httpclient,而在GWT SDK中,他们也使用了较旧版本的HttpClient,而该版本缺少我使用的方法。 This causes a conflict in eclipse where my code will no longer build from within eclipse because the HttpClient jar from the GWT SDK overrides the one I provided for the project. 这会导致eclipse中的冲突,因为我的代码将不再在eclipse中构建,因为GWT SDK中的HttpClient jar会覆盖我为项目提供的代码。 This prevents the running the application on the eclipse tomcat server. 这样可以防止在Eclipse Tomcat服务器上运行应用程序。

The question is, is there a way to override this behavior, the GWT SDK jars are not needed for the project they are only there to run the GWT tools. 问题是,是否有一种方法可以替代此行为,因此项目不需要GWT SDK jar,它们仅在其中运行GWT工具。

  • James 詹姆士

One of the solutions is to change the order of the libraries in the Eclipse Java build path of your project. 解决方案之一是更改项目的Eclipse Java构建路径中的库顺序。

By putting the jar containing the update version of HttpClient above GWT jar, you will have solved your problem. 通过将包含HttpClient的更新版本的jar放在GWT jar之上,您将解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM