views:

144

answers:

4

I try to do it the following way:

  1. Right click on the name of the project.

  2. Click on Build Path in the drop dawn menu.

  3. Click on "Configure Build Path"

And then I do not know what to do. Should I select "Source", "Projects", "Libraries", "Order and Export"?

In "Libraries" I have "Add JARs..." and "Add External JARs...". What should I select? (I have already a .jar file in the lib folder of my project.)

ADDED:

If I click on "Add JARs" in the "Libraries" tab, I see the "lib" sub-folder but if I go there I do not see my .jar file there (and I know that it is there).

+2  A: 
  1. Right click on the jar you want to add.
  2. Build Path > Add to Build Path

You're done.

If you want to add the Library with the Java Build Path view, as you tried you have to use Add JARs. If you copied the library via File System the Project is not in sync. You could press F5 on the selected Project.

If you edit outside of Eclipse a lot, you can enable auto-refresh by going to Window > Preferences menu, then in the Preferences dialog box, select General > Workspace. Check the Refresh automatically box.

codedevour
Sounds simple. But how do I find the .jar file to make the right click on it?
Roman
Maybe you have to `Refresh` your project (select your project and press `F5`)? Did you copied it there via Eclipse or File System?
codedevour
I copied it there with the File System. How can I refresh the Project?
Roman
Did my hints worked for you? If you like my answer you can consider accepting it.
codedevour
A: 

Click "Add Jar" and select the jar from your project path.

leonm
Should I do it in the "Libraries" tub? (I see "Add JAR" only there). If I go to the "lib" sub-folder I do not see there the .jar file (but it is there, I see it if I go to the folder with the file explorer).
Roman
A: 

If the jar is already in you project directory click "Add jar" in the Libraries-tab. If not click "Add external jar". That should do it.

If your jar does not show up when you click "Add jar" although you have copied it to your project directory you should refresh your project. Just go to your project explorer in eclipse, right click on the project-name and click "Refresh".

Ham
A: 

I think you are almost correct in adding the jar files to the Selected Project

Right click on the name of the project.

Click on Properties in the menu.

Click on "Java Build Path"

Then select "Libraries"

In "Libraries" Click "Add External JARs...".(if the jar files exists outside the project) Else Click "Add Jars" (if the jars Exists within the project)

Once you do this, workspace builds automatically and after that your application is set to use for the development.

harigm