Manifest.MF contains information about the files contained in the JAR file.
Whenever a JAR file is created, the manifest.mf file is created by default inside the META-INF folder and contains default entries like this:
Manifest-Version: 1.0 Created-By: 1.7.0_06 (Oracle Corporation)
These are records as "header: value" pairs. The first specifies the version of the manifest, and the second specifies the version of the JDK with which the JAR file is created.
Main class header: When the JAR file is used to bind the application in the package, we need to specify the class that serves as the entry point for the application. We provide this information using the Main-Class header of the manifest file,
Main class: {full class name}
The Main-Class value here is a class that has a main method. After specifying this entry, we can run the JAR file to run the application.
Class header: In most cases, we need to access other JAR files from classes packaged in the application JAR file. This can be done by providing your full paths in the manifest file using the "class-class header",
Path class: {jar1-name jar2-name directory-name / jar3-name}
This header can be used to specify external JAR files on the same local network, and not inside the current JAR.
Package version related headers: When a JAR file is used to control package versions, the following headers are used according to the Java language specification:
Headers in a manifest Header | Definition
Packing related seals:
We can also indicate whether any specific packages should be closed inside the JAR file, which means that all classes defined in this package should be archived in the same JAR file. This can be specified using the "Sealed Header",
Name: {package / some-package /} Sealed: true
Here, the package name must end with "/.
Increased security with manifest files:
We can use manifest file entries to ensure the security of the web application or applet that it packs with various attributes: Permissions, Codebae, Application Name, Reliability, and more.
Folder META-INF:
This folder contains the manifest file. In addition, it may contain more files containing metadata about the application. For example, in the EJB module JAR file, this folder contains the EJB deployment descriptor for the EJB module along with the manifest file for the JAR. In addition, it contains an xml file containing the mapping of abstract EJB links to the specific resources of the application server container on which it will run.
Reference:
https://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html