Link to home
Create AccountLog in
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

asked on

Export a jar from a jave project in eclipse

Hi,

I have an eclipse java project, it depends on some external jars. Is there a way for me to export the project as a jar, which includes those other jars embedded somehow? All I want to do is export one single jar so I can take it to another machine and run it, without having to link to the other jars externally.

Thanks
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

you just have to include the other jars in that project, it will be automatically included in that jar that you are exporting out of the project
Avatar of DJ_AM_Juicebox
DJ_AM_Juicebox

ASKER

Hi gurvinder372,

What do you mean by "include"? I'm using eclipse helios. To link to those external jars, I right click my project, choose properties. Click on Java Build Path. Click the Libraries item. Hit the Add External JARs button. I then choose the external jar files I need to link to.

Do I need to somehow import the jars locally into the project somehow, or is doing the above what you mean by "include" ?

Thanks!
If it is already a jar file, then you have to do as you have mentioned. Goto java build path, goto library tab, and include libraries
If the jar file you are looking for is the project in the same workspace, then you need to Goto java build path, goto Project tab, and include projects.

ASKER CERTIFIED SOLUTION
Avatar of Sathish David  Kumar N
Sathish David Kumar N
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
take the created jar and put it in web-inf/lib (class path)