Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Libraries in Eclipse?

Tags:

java

eclipse

I just recently downloaded the dom4j library, but for the life of me I have no idea how to access it. I dropped it in the plug-ins folder and rebooted Eclipse, without success. For some reason finding a straight answer for this is more difficult that I thought it would be.

like image 886
Hanna Avatar asked Feb 10 '11 20:02

Hanna


People also ask

How do I download Java Libraries in Eclipse?

A. Once you know where the files are located, you can add a user library to Eclipse. Step 3: Open the “Preferences” window in Eclipse. Navigate to “Java » Build Path » User Libraries” then on the left-hand side click on the “New” button, enter the file name and then click on the OK button.

How do I view external Libraries in Eclipse?

Right-click this project folder, and select "Build Path", and then select "Configure Build Path..." Select "Java Build Path" on the left, and then the "Libraries" tab. Click the "Classpath" line, and then click the "Add External JARS..." button. Locate and select the "breadboards.


2 Answers

No, don't do it that way.

From your Eclipse workspace, right click your project on the left pane -> Properties -> Java Build Path -> Add Jars -> add your jars here.

Tadaa!! :)

like image 172
limc Avatar answered Sep 22 '22 19:09

limc


Extract the jar, and put it somewhere in your Java project (usually under a "lib" subdirectory).

Right click the project, open its preferences, go for Java build path, and then the Libraries tab. You can add the library there with "add a jar".

If your jar is not open source, you may want to store it elsewhere and connect to it as an external jar.

like image 39
Uri Avatar answered Sep 21 '22 19:09

Uri