Java - JAR file command-line tool

Introduction

The following table lists the command-line options for the jar tool.

Option
Description
-c
Create a new JAR file.
-u
Update an existing JAR file.
-x
Extract a named file or all files from a JAR file.
-t
List the table of contents of a JAR file.
-f
Specify the JAR file name.
-m
Include the manifest information from the specified file.
-M
Do not create a manifest file.
-i

Generate index information for the specified JAR file. It creates an INDEX.LIST file in JAR file under the
META-INF directory.
-0
Do not compress the entries in the JAR file.
-e

Add the specified class name as the value for the Main-Class entry in the main section of the
manifest file.
-v
Generate verbose output on the standard output
-C
Change to the specified directory and include the following files in a JAR file.

Related Topics