I am getting the java.lang.NoClassDefFoundError:org.apache.http.client.CredentialsProvider error
even after importing the Web client jar files.
Please find the screenshot below.
Can any one help me where I am going wrong.
Most of the time, NoClassDefFoundError
happen when there is missing dependencies to your project. Note that there is other possibilities...
For more information on NoClassDefFoundError
you might want to check this thread
Why am I getting a NoClassDefFoundError in Java?
In your case, as @Jens already mentionned, we can see in your referenced libraries that you are missing httpclient.jar
See the http components of Apache download page.
java.lang.NoClassDefFoundError:org.apache.http.client.CredentialsProvider
error indicates that httpclient-4.0.3.jar
file is mission in your class path.
Configure it in your class path Right click project -> Build Path -> Configure Build Path -> Libraries -> Add Excernal Jars -> select jar file