如何导入" org.apache.http.client.HttpClient"在Eclipse? [英] how to import "org.apache.http.client.HttpClient" in Eclipse?

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

问题描述

我已经按照步骤的 httpcore.jar >此处,但是当我写进口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 <之间的差异/ code>?

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

推荐答案

首先: HTTP ://hc.apache.org/httpclient-3.x/

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

The Commons HttpClient project is now end of life, and is no longer being developed. It has been replaced by the Apache HttpComponents project in its HttpClient and HttpCore modules, which offer better performance and more flexibility.

所以,你需要使用的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?

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

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