Solved

combining jars

Posted on 2013-11-14
4
152 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now