"jar" Commands to Split A JAR File
How to split a JAR file into two JAR files? I jave a huge JAR file and I only need to use one package of classes from the JAR file.
If you have a huge JAR file and want to build a smaller JAR file with classes from one package from the huge JAR file, you can follow these steps:
1. Put the huge 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 classes from a given package:
\fyicenter\lib>cd temp \fyicenter\lib\temp>jar -xf ..\activation.jar com/sub/activation
4. Create a new JAR file with only one package
\fyicenter\lib\temp>jar -cf ..\activation-sun.jar .
5. Take the activation-sun.jar in the .\lib folder and delete .\lib\temp folder.
Back to FAQ for JDK JAR (Java ARchive) Tool.
2016-05-28, 4272👍, 0💬
JDK 11 jdk.jdi.jmod is the JMOD file for JDK 11 JDI (Java Debug Interface) tool. JDK 11 JDI tool com...
commons-lang-2.6.jar is the JAR file for Apache Commons Lang 2.6, which provides a host of helper ut...
XMLSchema, Release 1.4.2, is a lightweight Java object model that can be used to manipulate and gene...
JDK 11 jdk.jdeps.jmod is the JMOD file for JDK 11 JDeps tool, which can be invoked by the "jdeps" co...
JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "jav...