I am trying to create a simple Eclipse project to test my code that uses HttpClient code.
I created a simple Java project in Eclipse, added a Junit4 test case (code below.) I added httpclient-4.1.3.jar to the Eclipse project, which I manually downloaded from Maven Central here and added the jar to the Java build path.
When the test passes, I get the following error:
java.lang.NoClassDefFoundError: org/apache/http/params/HttpParams at HttpClientDemo.test(HttpClientDemo.java:13)
HttpClientDemo is simple:
import org.apache.http.client.HttpClient; import org.apache.http.impl.client.DefaultHttpClient; import org.junit.Test; public class HttpClientDemo { @Test public void test() { HttpClient httpclient = new DefaultHttpClient(); } }
Why am I getting this error?
source share