HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

jar — Java applications/libraries packager. More information: <https://docs.oracle.com/javase/tutorial/dep

Submitted by: @import:tldr-pages··
0
Viewed 0 times
librariescommandclijavaapplicationsmorepackagerjar

Problem

How to use the jar command: Java applications/libraries packager. More information: <https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html>.

Solution

jar — Java applications/libraries packager. More information: <https://docs.oracle.com/javase/tutorial/deployment/jar/basicsindex.html>.

Recursively archive all files in the current directory into a .jar file:
jar cf {{file.jar}} *


Unzip .jar/.war file to the current directory:
jar -xvf {{file.jar}}


List a .jar/.war file content:
jar tf {{path/to/file.jar}}


List a .jar/.war file content with verbose output:
jar tvf {{path/to/file.jar}}

Code Snippets

Recursively archive all files in the current directory into a `.jar` file

jar cf {{file.jar}} *

Unzip `.jar`/`.war` file to the current directory

jar -xvf {{file.jar}}

List a `.jar`/`.war` file content

jar tf {{path/to/file.jar}}

List a `.jar`/`.war` file content with verbose output

jar tvf {{path/to/file.jar}}

Context

tldr-pages: common/jar

Revisions (0)

No revisions yet.