Solved

combining jars

Posted on 2013-11-14
4
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 28

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

623 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