In this chapter, we will explain how to set an environment for HttpClient in Eclipse IDE. Before proceeding with the installation, make sure that you already have Eclipse installed in your system. If not, download and install Eclipse.
For more information on Eclipse, please refer to our Eclipse Tutorial.
Open the official homepage of the HttpClient (components) website and go to the download page
Then, download the latest stable version of HttpClient. Here, throughout the tutorial, we are using the version 4.5.6 hence download the file 4.5.6.zip.
Within the downloaded folder, you will find a folder named lib and this contains the required Jar files that are to be added in the classpath of your project, to work with HttpClient.
Open eclipse and create a sample project. Right click on the project select the option Build Path → Configure Build Path as shown below.
In the Java Build Path frame in the Libraries tab, click on Add External JARs.
And select all the jar files in the lib folder and, click on Apply and Close.
You are all set to work with HttpClient library in eclipse.