Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing dependency for HttpClient

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?

like image 461
Stijn.V Avatar asked Jun 14 '11 08:06

Stijn.V


4 Answers

Probably you are missing httpcore jar.

like image 114
sudmong Avatar answered Oct 31 '22 10:10

sudmong


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.

like image 37
Michael Avatar answered Oct 31 '22 09:10

Michael


I think you'll also need:

httpcore-4.x.x.jar
like image 2
planetjones Avatar answered Oct 31 '22 10:10

planetjones


http://findjar.com/class/org/apache/http/HttpResponse.html

like image 1
Bob Yoplait Avatar answered Oct 31 '22 11:10

Bob Yoplait