"jar" Commands to Merge Two JAR Files
How to merge two JAR files with "jar" commands? I am tired of specifying multiple JAR files in the classpath.
If you are tired of specifying multiple JAR files in the classpath, you can merge all JAR files into a single JAR file using these steps:
1. Put all JAR files into .\lib folder.
2. Create a sub folder called temp under .\lib folder.
\fyicenter>cd lib \fyicenter\lib>mkdir temp
3. Go to the .\lib\temp folder and extract all JAR files:
\fyicenter\lib>cd temp \fyicenter\lib\temp>jar -xf ..\A.jar \fyicenter\lib\temp>jar -xf ..\B.jar ...
4. Add all classes into a single JAR file, mySuper.jar:
\fyicenter\lib\temp>jar -cf ..\mySuper.jar .
5. Take the mySuper.jar the .\lib folder and delete .\lib\temp folder.
Back to FAQ for JDK JAR (Java ARchive) Tool.
2016-06-03, 1446👍, 0💬
dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platfo...
The JMX technology provides the tools for building distributed, Web-based, modular and dynamic solut...
XML Serializer, Release 2.7.1, allows you to write out XML, HTML etc. as a stream of characters from...
JAXP (Java API for XML Processing) API, Release 1.4.2, is the reference implementation of the JAXP s...
iText is an ideal library for developers looking to enhance web- and other applications with dynamic...