To extract a jar file from the command-line:

  • jar xf myapp.jar -extract a jar-file into jar-file-name-dir (within same dir)
  • jar xf myapp.jar file1 file2 file3 -extractspecific files only
  • jar cf myapp.jar file1 file2 dir1 -create a jar-file from a path(s)
  • jar tf myapp.jar -list contents of a jar-file
  • jre -cp myapp.jar MyMainClass -execute main class within a jar-file
  • java -jar myapp.jar