Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
"jar -cvfm" to Create a JAR with a Manifest File
What is the "jar" command to create a JAR file with my own manifest file?
✍: FYIcenter.com
To create a JAR file with a folder and your own manifest file, you can use the "jar -cvfm jarname manifestfile foldername" command.
For example, the following session creates a new JAR file with all files in a sub folder and a manifest file:
\fyicenter>"%java_home%\bin\jar" -xvf jms.jar \fyicenter>"%java_home%\bin\jar" -cvfm myJar.jar META-INF\MANIFEST.MF .\javax added manifest adding: javax/(in = 0) (out= 0)(stored 0%) adding: javax/jms/(in = 0) (out= 0)(stored 0%) adding: javax/jms/BytesMessage.class(in = 1202) (out= 494)(deflated 58%) adding: javax/jms/Connection.class(in = 945) (out= 373)(deflated 60%) adding: javax/jms/ConnectionConsumer.class(in = 275) (out= 189)(deflated 31%) adding: javax/jms/ConnectionFactory.class(in = 311) (out= 179)(deflated 42%) adding: javax/jms/ConnectionMetaData.class(in = 544) (out= 271)(deflated 50%) adding: javax/jms/DeliveryMode.class(in = 207) (out= 160)(deflated 22%) ... \fyicenter>del META-INF\MANIFEST.MF \fyicenter>"%java_home%\bin\jar" -xvf myJar.jar META-INF\MANIFEST.MF inflated: META-INF/MANIFEST.MF \fyicenter>type META-INF\MANIFEST.MF Manifest-Version: 1.0 Ant-Version: Apache Ant 1.5.3 Created-By: 1.3.0-C (Sun Microsystems Inc.)
The output proves that we haved included the orginal MANIFEST.MF in the myJar.jar correctly. Now myJar.jar is perfect copy of jms.jar.
Back to FAQ for JDK JAR (Java ARchive) Tool.
2015-11-09, 3974🔥, 0💬
Popular Posts:
JDK 17 jdk.compiler.jmod is the JMOD file for JDK 17 Compiler tool, which can be invoked by the "jav...
What Is wstx-asl-3.2.8.jar? wstx-asl-3.2.8.jar is JAR file for the ASL component of Woodstox 3.2.8. ...
io.jar is a component in iText Java library to provide input/output functionalities. iText Java libr...
Apache Log4j API provides the interface that applications should code to and provides the adapter co...
Apache Ant is a Java-based build tool. In theory, it is kind of like make, without make's wrinkles. ...