Skip to content

Instantly share code, notes, and snippets.

@skellertor
Last active September 18, 2015 06:38
Show Gist options
  • Save skellertor/626e798df1cb28dcf7ea to your computer and use it in GitHub Desktop.
Save skellertor/626e798df1cb28dcf7ea to your computer and use it in GitHub Desktop.
Working with jar files
/* Create a JAR file from files */

jar cf jar-file.jar input-file(s)

Options ☕

  • c: indicates you want to create a JAR file
  • f: indicates you want to direct output to a file rather than stdout
/* View contents of a JAR file */

jar tf jar-file.jar

Options ☕

  • t: indicates that you want to view the table of contents of the JAR file
  • f: indicates that the JAR file whose contents are to be viewed is specified on the command line
/* Extract contents of a JAR file */

jar xf jar-file.jar

Options ☕

  • x: indicates that you want to extract files from the JAR archive
  • f: ndicates that the JAR file from which files are to be extracted is specified on the command line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment