Issue
The following
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
can't be resolved. I downloaded the Apache Http packages and imported them via the external jars option, but it still won't get resolved. In Android it seems to work, guessing its in the SDK, but here I'm not doing Android. Did I get the wrong packages?
I believe this is the link:
Solution
It sounds OK:
The .jar file in question should be something like
httpcore-4.0.1.jar
. Please confirm the name.Adding this to "External Libraries" is absolutely the correct thing to do.
For compiling in the Eclipse IDE, you must:
Select your project
Select
"Build Path" > "Add External Libraries"
For running in the Eclipse IDE, you must
Select
"Run" > "Run configurations"
.
Choose your (Java Application?) configuration.Select
"Classpath" > "Add External Jar"
For running outside of the Eclipse IDE, you must make sure the .jar file is present and your
-cp (Classpath)
argument is set correctly.
Answered By - paulsm4
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.