How can I add .jar to my build path in Eclipse?

I am trying to do it like this:

  • Right-click the project name.

  • Click Build Path in the drop-down menu.

  • Click Customize Build Path

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

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

ADDED:

If I click “Add JAR” on the “Libraries” tab, I see the “lib” subfolder, but if I go there, I don’t see my .jar file there (and I know that it is).

+5
source share
4 answers
  • Right-click on the jar that you want to add.
  • Build Path > Add to Build Path

You are done.

If you want to add a library to the view Java Build Pathas you tried, you should use Add JARs. If you copied the library through the file system, the project is not synchronized. You can click F5on the selected project.

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

+6
source

I think you are adding jar files to the selected project almost correctly

.

"" .

" Java"

""

"" " JAR..." ( jar ) Else " " ( )

, , .

+1

" " .

0

jar , " " "". " ". .

If your jar does not appear when you click "Add Jar", although you have copied it into the project directory, you must update your project. Just go to your Explorer project in eclipse, right-click on the project name and click on "Refresh".

0
source

All Articles