Adding an external Java library to an Eclipse project

I wanted to use a method from the Apache Commons Lang library in an
Eclipse project. Here’s how to do that:

1. Download the library. (The Apache Commons Lang library is found here: http://commons.apache.org/proper/commons-lang/download_lang.cgi Select the version appropriate for your version of Java. You probably want the latest, unless you’re using an old, old version of Java. Also, get the binary rather than the source, unless you want to compile it for yourself.)

2. Create a “lib” folder in your Eclipse project. Right-click on the project name and select “New->Folder” Call the folder “lib”

3. Copy the jar into the folder you just created.

4. In Eclipse, find the jar file in the lib folder and right-click on it. Select “Build Path->Add to Build Path” The jar file will now be listed in your project under “Referenced Libraries.”