"jar -tf" Command to List Files in a JAR

Q

What is the "jar" command to list all files in a JAR file?

✍: FYIcenter.com

A

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

\fyicenter>"%java_home%\bin\jar" -tf jms.jar
META-INF/
META-INF/MANIFEST.MF
javax/
javax/jms/
javax/jms/BytesMessage.class
javax/jms/Connection.class
javax/jms/ConnectionConsumer.class
javax/jms/ConnectionFactory.class
javax/jms/ConnectionMetaData.class
...

As you can see, the "jar -tf" command lists all folders and files in the specified JAR file.

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

2015-11-07, 2151👍, 0💬