What is in the manifest file?

In a JAR archive, you can find the META-INF/MANIFEST.MF file. This is the manifest of the archive, which stores its metadata. The manifest is usually added by the same tool that builds the JAR file, such as maven-jar-plugin or the JDK's jar command.

The manifest is a text file consisting of headers in the format key: value. Headers are grouped into sections. The file starts with the main section, which describes the metadata for the entire archive. This is followed by sections for individual packages and files, separated by blank lines, where common headers can be overridden. The JVM ignores unknown headers, allowing third-party tools to store their specific metadata in the manifest.

Here are some commonly used headers:
  • Archive information: Manifest-Version, Created-By, Multi-Release, Built-By
  • Main-classthe entry point of the application
  • Application classpath
  • Extension information (Specification and Implementation, deprecated)
  • OSGI bundle headers
  • File types and hashes (particularly applicable in Android applications)

You can find a complete list of standard headers in the documentation.