JAR (Java Archive) file, Manifest file, JAR utility, commands

JAR(Java Archive) file: A JAR file is a compressed file which has a collection of Java software components. Collection of classes and resources can be saved in a JAR file. By using JAR files softwares can be installed easily. Digital signatures can also be added to JAR files for authenticity.

Manifest file: A manifest file is used to specify a component to be Java bean in a JAR file. To check whether a component is bean, you have to look for:

Java-Bean: True

JAR utility: It is used for creating JAR files.


jar options files

To create a JAR file:

jar cf MoreProcess.jar *.class

where c command is used to inform that a new archive should be created and f informs that first lement is name of archive.

To tabulate a JAR file:

jar tf MoreProcess.jar

To extract a JAR file:

jar xf MoreProcess.jar

List of commands in JAR:

  • 0: Do not use compression.
  • C: For changing directories during command execution.
  • M: Manifest file not created.
  • c: Create new archive.
  • f: First element in file is name of archive.
  • i: For providing index information.
  • m: Second element in file is name of external manifest file.
  • t: Tabulate archive contents.
  • u: Update JAR file.
  • v: For verbose output.
  • x: Extract file from archive.

Leave a Reply