views:

40

answers:

2

Hey there,

I'm a new Java developer I've only ever done PHP in the past and all the functions I needed to use were built into PHP. This doesn't seem to be the case with Java though!

I downloaded Eclipse and wrote a hello world and some other things and everything is working great for me! I downloaded httpclient (from http://hc.apache.org/downloads.cgi) and I can see two files, httpclient-4.0.2.jar and httpmime-4.0.2.jar but I'm not sure how I can add them into my program and start using them to build something with!

Any help would be appreciated so much and I'm sorry if this comes off as a trolling question of sorts, I'm really new to this!

A: 

In Eclipse, right click on your project in the Package Explorer and choose Build Path > Add External Archives... Navigate to your jar files, select them, and click Open.

Uh Clem
A: 

Hi in any environment weather it be eclipse, jdeveloper, intellj, netbeans or commandline you need to add the downloaded jar files to the classpath/libraries. This is so the JVM know where to look for external libraries.

In Eclipse in the project explorer right click on the root project and go to properties. Then in the left hand list go to Java build path, once selected go to libraries then go to add external libraries. Once selected they should appear in the list next to the button.

hope this helps.

kohlerfc