?
Solved

combining jars

Posted on 2013-11-14
4
Medium Priority
?
168 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 800 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 800 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

718 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