java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient

Hi,

I have a program which is developed using the http client. It is giving following error:

java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient

How to resolve this?

Thanks

View Answers

April 25, 2017 at 12:09 AM

Hi,

This comes when you are using Apache httpclient and this library is not available in the project.

If you download the org.apache.httpcomponents httpclient jar file and include in your project, then the problem will be solved.

In maven use the following dependency:

<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpclient</artifactId>
    <version>4.5.2</version>
</dependency>

Thanks









Related Tutorials/Questions & Answers:

Ads