38

How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library.

That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand a given library, you will see a list of JAR files included in that library. I want to add an additional JAR file to one of these libraries.

I am using Version 3.4.0 of Eclipse.

Paul Reiners
  • 8,576
  • 33
  • 117
  • 202
  • Inside a jar, I see 'source attachment, javadoc location, Native library location and Access rules... but no other jar. What version of eclipse are you using ? – VonC Oct 07 '08 at 15:41
  • I am using Version 3.4.0 of Eclipse. – Paul Reiners Oct 07 '08 at 15:46
  • Possible duplicate of [How to import a jar in Eclipse](http://stackoverflow.com/questions/3280353/how-to-import-a-jar-in-eclipse) – patryk.beza Apr 02 '16 at 18:53

4 Answers4

50

In eclipse Galileo :

  • Open the project's properties
  • Select Java Build Path
  • Select Libraries tab

From there you can Add External Jars

Jla
  • 11,304
  • 14
  • 61
  • 84
19

In Eclipse Ganymede (3.4.0):

  1. Select the library and click "Edit" (left side of the window)
  2. Click "User Libraries"
  3. Select the library again and click "Add JARs"
approxiblue
  • 6,982
  • 16
  • 51
  • 59
idrosid
  • 7,983
  • 5
  • 44
  • 41
  • This answer is not valid for the current version of Eclipse (Mars 4.5.1). It may or may not be worth removing your answer as it pertains to an outdated version of Eclipse from seven years ago. – AStopher Nov 14 '15 at 23:05
  • 1
    @bob I added the specific version to the answer (3.4.0). We can leave it here in case someone has to stick with older versions of Eclipse (no one I hope). It's not harming anyone and it doesn't need to be removed. – approxiblue Nov 14 '15 at 23:08
4

You might also consider using a build tool like Maven to manage your dependencies. It is very easy to setup and helps manage those dependencies automatically in eclipse. Definitely worth the effort if you have a large project with a lot of external dependencies.

Johnny Wey
  • 916
  • 7
  • 6
3

As of Helios Service Release 2, there is no longer support for JAR files.You can add them, but Eclipse will not recognize them as libraries, therefore you can only "import" but can never use.

Osi
  • 31
  • 1