"jar -xvf" Command to Extract Files from a JAR


What is the "jar" command to extract all files from a JAR file?

✍: FYIcenter.com


To extract all files in a JAR file, you can use the "jar -xvf" command. For example:

\fyicenter>"%java_home%\bin\jar" -xvf jms.jar
  created: META-INF/
  created: javax/
  created: javax/jms/
 inflated: javax/jms/BytesMessage.class
 inflated: javax/jms/Connection.class
 inflated: javax/jms/ConnectionConsumer.class
 inflated: javax/jms/ConnectionFactory.class
 inflated: javax/jms/ConnectionMetaData.class

   <DIR>          .
   <DIR>          ..
   <DIR>          javax
          26,257 jms.jar
   <DIR>          META-INF

Note that the "v" option generated verbose output on your screen.

Back to FAQ for JDK JAR (Java ARchive) Tool.

2015-11-07, 4176🔥, 0💬