Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HTTPCLIENT in Java - "does not exist" when importing

843789Feb 7 2010 — edited Feb 7 2010
I am trying to import:
import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.param.HttpMethodParams;
but netbeans states that it doesn't exist.

I have added the external JARS to the libraries folder within Projects:
apache-mime4j0.6.jar
commons-codec-1.3.jar
commons-logging-1.1.1.jar
httpclient-4.0.1.jar
httpcore-4.0.1.jar
httpmime-4.0.1.jar

But still no luck. I have also tried this in Eclipse but I get "cannot be resolved". I must be doing something fundamentally wrong, but I cannot figure it out. :-(

I tried adding a "." between httpclient and this seemed to remove the "does not exist" error:
import org.apache*.*http.client.*;
import org.apache.http*.*client.methods.*;
import org.apache.http*.*client.param.HttpMethodParams;

But when trying:
  HttpClient client = new HttpClient();
For "HttpClient()" I get is abstract, cannot be instantiated.

I dont think I should have edited the imports, but I really cannot work out what on earth is going wrong :-(

Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 7 2010
Added on Feb 7 2010
2 comments
1,370 views