缺少 HttpClient 的依赖项
我在 Java 桌面应用程序中使用 HttpClient。我已将 httpclient-4.0.1.jar 和 httpmime-4.0.1.jar 添加到构建路径,但收到错误“The type org.apache. http.HttpResponse 无法解析。它是从所需的 .class 文件间接引用的。有谁知道我缺少哪个依赖项/jar?
I'm using a HttpClient in a Java desktop application. I've added httpclient-4.0.1.jar and httpmime-4.0.1.jar to the build path, but I receive the error 'The type org.apache.http.HttpResponse cannot be resolved. It is indirectly referenced from required .class files'. Does anyone know which dependency/jar I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
可能您缺少 httpcore jar。
Probably you are missing httpcore jar.
该类是 HttpCore 库的一部分,这里有一个显示其用途的链接:
http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/class-use/HttpResponse.html
你'需要将 jar 包含在您的类路径/lib 中。
That class is part of the HttpCore library, here's a link showing it's uses:
http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/class-use/HttpResponse.html
You'll need to include the jar in your classpath / lib.
我想你还需要:
I think you'll also need:
http://findjar.com/class/org/apache/http/HttpResponse.html
http://findjar.com/class/org/apache/http/HttpResponse.html