Extract the contents of JAR Files

Command for extracting the contents of JAR File

jar xf jar-file-name.jar [file(s)_inside]

where,

  • jar indicates to call the jar tool.
  • x indicates to extract the content.
  • f indicates to extract from the file.
  • [file(s)_inside] is optional, if you need to extract only specific files, you can give file names separated by space.

Example

jar xf myjar.jar

Output

The contents of Jar File will be extracted in the current folder.


Other commands

  • v indicates to verbose information about extracted files.

    Example

    jar xfv myJar.jar

    Output

    created: META-INF/

    extracted: META-INF/MANIFEST.MF

    extracted: Music.class

    extracted: Equalizer.class

    extracted: song.mp3