本文介绍了如何导入" org.apache.http.client.HttpClient"在Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经按照步骤的,但是当我写进口org.apache.http.client.HttpClient ,它仍然无法找到。
罐子已经被Maven的下载。

I have tried httpcore.jar by following the step here, but when I write import org.apache.http.client.HttpClient, it still can't be found.The jar is already downloaded by Maven.

的HttpCore 导入正确的lib org.apache.http.client.HttpClient
org.apache.http.client.HttpClient 只是用于开发Android?

Is httpcore the right lib for importing org.apache.http.client.HttpClient?or org.apache.http.client.HttpClient is just used for Android developing?

另外一个问题,就是 org.apache.http.client.HttpClient org.apache.commons.httpclient.HttpClient ?

Another question, what is the difference between org.apache.http.client.HttpClient and org.apache.commons.httpclient.HttpClient?

推荐答案

首先:

下议院HttpClient的项目现在生活的结束,而不再
  正在开发中。它已取代了Apache HttpComponents
  项目在HttpClient的和的HttpCore模块,提供更好的
  性能和更大的灵活性。

所以,你需要使用的HttpClient(http://hc.apache.org/httpcomponents-client-ga/index.html),而不是Commons的HttpClient(取你说的软件包名称的样子)。

So, you need to use HttpClient (http://hc.apache.org/httpcomponents-client-ga/index.html), not Commons HttpClient (take a look in the name of the packages that you said).

是的,org.apache.http.client.HttpClient是正确的包。

Yes, org.apache.http.client.HttpClient is the right package.

难道你有一定的Maven在获得的.jar和它在你的类路径?

Did you have certain that Maven obtained the .jar and it is in your classpath?

这篇关于如何导入" org.apache.http.client.HttpClient"在Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 00:23