Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import a jar in Eclipse

Tags:

java

eclipse

jar

How do I import a jar in Eclipse?

like image 755
user395734 Avatar asked Jul 19 '10 10:07

user395734


People also ask

Why can I not add external JARs in Eclipse?

If your project builds with Java 9+ make sure you've selected Classpath (as shown here). You should also be able to add the JAR with right-click on the project > Build Path > Add External Archives.... If that doesn't help, would you tell use the version and package of Eclipse IDE you're using?


1 Answers

You can add a jar in Eclipse by right-clicking on the Project → Build Path → Configure Build Path. Under Libraries tab, click Add Jars or Add External JARs and give the Jar. A quick demo here.

enter image description here

The above solution is obviously a "Quick" one. However, if you are working on a project where you need to commit files to the source control repository, I would recommend adding Jar files to a dedicated library folder within your source control repository and referencing few or all of them as mentioned above.

like image 114
bragboy Avatar answered Sep 29 '22 00:09

bragboy