Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse. Copy JAR file into project

How to include (NOT ONLY reference) JAR file into existing project? I added it by using Project properties - Build path - add external jar's. But when I export my project, and then import it in another computer, this library was missing.

like image 968
WelcomeTo Avatar asked Dec 24 '11 17:12

WelcomeTo


3 Answers

Drag it into your project view so it appears in the project as any other file.

Right-click the jar in the project view and add to build path.

like image 61
Thorbjørn Ravn Andersen Avatar answered Oct 04 '22 12:10

Thorbjørn Ravn Andersen


Put your jars into a directory of your project e.g yourproject/lib so that external libraries are accessed through a relative path. And then use "Add JARs" option to add the jar to build path as in eboix's link.

like image 39
suat Avatar answered Oct 04 '22 12:10

suat


You want to export your project as an archive (Export -> General -> Archive File), and then import your project as an existing project (Import -> General -> Existing Projects into Workspace). This way the project will be identical to the exported version and all of the configuration will be right.

Oh, and do what the other people suggest and copy the Jar file into the project so you don't have to reference it as an external Jar file (and everything is in one place).

like image 44
Francis Upton IV Avatar answered Oct 04 '22 14:10

Francis Upton IV