How to Install Java Libraries

Eclipse IDERecently I received a bunch of emails asking how to install java libraries. So, in this tutorial I’ll show you how.

Since I use Eclipse in all of my tutorials, I’ll show you how to install java libraries with Eclipse. I use Eclipse because it is free and looks the same on every operating system.

Specifically I’ll show you how to install the very popular Apache Commons Java Library.

Get Apache Commons Java Library

This is real simple. Go to this page Apache Commonsย and download and unzip thisย commons-lang3-3.1-bin.zip.

Install Java Library in Eclipse

Here you’ll see a series of images that will walk you through the installation of the Apache Commons library. As you can see, this series of steps will work for any Java Library.

Of course you need to have Eclipse. I use the version of Eclipse namedย Eclipse IDE for Java Developers. Now open Eclipse and follow what you see in the pictures below.

Right click on the top most folder in the Eclipse Package Explorer and create a new folder

Install Java Library

Create a new folder named lib as you see below.

Install Java Library 2

Right click on the top most folder again in package explorer and click import.

 Install Java Library 3

Select General and then File System.

Install Java Library 4

Browse to the location for your Java jar files and select them. Click Finish

Install Java Library 5

Right click on the top most folder again in package explorer and click properties.

Install Java Library 6

Click Libraries, Add Jars, Select the jar files and hit OK.

Install-Java-Library-7

Now if you want to use the Apache Commons library for example, just add the following line of code to your code import org.apache.commons.lang3.*;

That’s it! If you want to learn java, I have a pretty nice Java Video Tutorial.

I hope that helped you out. If you have any questions leave them below.

If you like videos like this tell Google [googleplusone]
To make me extra happy, feel free to share it [nttfblike]

Till Next Time

Think Tank

25 thoughts on “How to Install Java Libraries”

  1. Sorry… even entering comments produces errors…

    I recently downloaded Eclipse ee for java developers. I am only using 1.6. I dont see a need to hassle with 1.7 due to my newness of programming.

    When I go to… File>New, the list is blank and shows

    I cant assume i have done anything wrong because I just installed it and have not messed with anything.

    Thank you in advance,
    Matt

    1. Try reinstalling eclipse Indigo. The Juno version (the newest) seems to be buggy. Just search for Eclipse Indigo and you’ll find it. I hope that helps

  2. Hi there — Thanks very much for this.

    How do you determine what to include in the import line? In your example, you have:
    import org.apache.commons.lang3.*;

    For other libraries, how would you figure that out?

    Thanks!

  3. hello there, thanks for your nice turorials, I found all of them great!
    I wanted to install java library in Netbeans, since I work in Netbeans not Eclipise. Can I just do the same way as you taught here? Thanks again.

  4. There are two recommendations that I would like to make to your great set of instructions:
    1. At the very beginning: “Create a new Java Project. Name it Java Code.”

    2. Just before the import instructions, “unzip the file commons-lang3-3.1-bin.zip”.

    Thanks.

  5. There are to suggestions that I would like to make to your great set of instructions.

    1. At the beginning add, “Create a new Java project in Eclipse. Call it Java Code.”

    2. Before the import instructions add, “unzip the file commons-lang3-3.1-bin.zip

    Thanks.

    1. Thank you very much ๐Ÿ™‚ I don’t care much about views. There are many things that I do that cause me to lose views. For example if I made a bunch of 5 minute videos instead of 25 minute videos that are edited down from 45 minute videos I could quadruple my view count. That doesn’t matter to me. I just do this to help and I don’t care about money

  6. Hi Derek, I add the the jar files to the library but every time I try to import the Apache Commons library it says that The import org.apache cannot be resolved. Am I suppose to add the files to the System Library itself?

    1. This should help. You need to add the required jar to your build path.Right click on your project in the Package Explorer,then select Build Path -> Configure Build Path, click on Libraries then click on Add JARs. Now point your required.jar from the Add JARs dialog.

      1. I had the same problem and you probably saved me an hour or two of research with that response. Thanks. I’m enjoying the videos.

Leave a Reply

Your email address will not be published. Required fields are marked *