Search code examples
javaeclipseapache-commons

Install Apache Package on Eclipse


I'm trying to get started with Http Client with Java on Eclipse, but the IDE complains that the libraries are missing.

In particular I'm trying to compile this example but eclipse complain that the import declaration is pointing towards an unknow library...

Could someone point me to a tutorial on how to install the apache libraries on eclipse?

I tried to download the sources or binaries and adding them to the path with no avail... thanx :D


Solution

  • They need to go in the compiletime/runtime classpath. It's called Build Path in an IDE like Eclipse.

    Here's the easiest way:

    • Drop the JARs in the project folder.
    • Select the JARs, right click, choose Build Path and then Add to Build Path.

    alt text