Solved

combining jars

Posted on 2013-11-14
4
155 Views
Last Modified: 2013-11-20
hi guys

We have multiple jars in our project

customCross.jar
customPath.jar


Is there anyway i can combine these two jars into one singe jar and call it
customProducts.jar?

We are deploying our project on a unix box, Any windows or unix option would be fine.
Any ideas?
thanks
0
Comment
Question by:royjayd
4 Comments
 
LVL 19

Expert Comment

by:xterm
ID: 39648529
They are just zip files - on a Linux box in the directory containing the two jar files, do:

mkdir tmpfolder
cd tmpfolder
unzip ../customCross.jar
unzip ../customPath.jar
zip -r ../customProducts.jar *
cd .. && rm -rf tmpfolder

You will of course have to change your code to reference the new jar name afterwards.
0
 
LVL 26

Accepted Solution

by:
dpearson earned 200 total points
ID: 39648688
There are also tools available that specifically help do this, e.g. One-Jar:
http://one-jar.sourceforge.net/

Doug
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 200 total points
ID: 39648906
Yes - use a proper tool. jars contain manifests and other metadata, so they are by no means 'just zip files'. You need to be careful - unless you're sure of the manifests, e.g. you create them.
If you're using Eclipse you don't need 3rd party tools (although it might internally use a One-Jar derivative) - just export with 'dependent jars' selected
0
 

Author Closing Comment

by:royjayd
ID: 39663353
thanks
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
numbers ascending pyramid 101 194
Java - Why doesn't this JFrame work 3 59
javap bin 2 34
sql import cannot be resolved jsp 3 20
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question