1

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.

enter image description here

Can any one help me where I am going wrong.

Jens
  • 67,715
  • 15
  • 98
  • 113
bharathi
  • 6,019
  • 23
  • 90
  • 152

3 Answers3

2

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.

Community
  • 1
  • 1
Jean-François Savard
  • 20,626
  • 7
  • 49
  • 76
1

You have to add the httpclient.jar from apache to your classpath. You can download it here

Jens
  • 67,715
  • 15
  • 98
  • 113
0

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

atish shimpi
  • 4,873
  • 2
  • 32
  • 50