WelcomeTo
WelcomeTo

Reputation: 20591

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.

Upvotes: 5

Views: 9943

Answers (3)

suat
suat

Reputation: 4289

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.

Upvotes: 2

Francis Upton IV
Francis Upton IV

Reputation: 19443

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).

Upvotes: 1

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.

Upvotes: 8

Related Questions