I. Preface by executing a form such as the JAR-CVF src.jar src command to package multiple. class files into a jar package, you will find that the jar package has more than one mate-inf/ma in addition to the SRC directory. INFEST. MF, what's that for? In fact, the description information about the jar package, the configuration information at startup and security information are all kept under Meta-inf, so it is important to understand the Meta-inf directory for publishing and deployment! The following is only part of the content of the collation, and later in-depth practice after the completion of the supplement. Official documents: Http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html II, Meta-inf/mainfest. The MF manifest file consists of element meta-inf/mainfest. The MF manifest file consists of 1 main-section and 0 to N individual-section, and each section contains multiple attribute, where attribute in Main-section is named Main-attribute, while the attribute in Individual-section is named Perentry-attribute. Each attribute is used as a delimiter (used as a delimiter under UNIX and used as a delimiter under Mac). Individual-section identifies the range with a perentry-attribute named name, and acts as the starting row for the zone. Example: manifest-version:1.0 created-by:1.2 (Sun Microsystems Inc.) Sealed:true Name:foo/bar/sealed:false main-section is used to describe the security, configuration information, and default information for all packages and files within a jar package. Each individual-section is used to describe a single package or file in a jar package, but not every package and file in the jar package must be configured with Individual-section, but for files that need to be signed you must configure the corresponding It's individual-section. Three, Main-attribute detailed 1. General Properties Mainfest-version:jar version number created-by: Producer Signature-version: Signature version Class-path: A list of dependencies, separated by a space if multiple dependencies exist. The dependency path is relative path 2 with the jar package path as the reference system. Executable Jar Package Property Main-class:main function is located in the fully qualified class name four, Perentry-attribute detailed 1. The Name property, the starting property of the Individual-section, the package naming specification, such as: com/test/myapp/, the file naming specification form: Com/test/myapp/myapp.class. 2. Define the file content content-type:mime type (format: Type/subtype. For example, Image/jpeg) five, note 1. Key-value pairs occupy one or more rows independently of each other; 2. The maximum length per line is 72 characters; 3. The last character of each line must end with a carriage return newline character, and the carriage return newline character cannot have spaces (using regular expressions to express each line specification is/^.+\s\r\n$/); 4. If the key-value pair occupies more than one row, then from the second line, you must start with a space or more (the specification for expressing the second row and the remaining lines using regular expressions is/^[]{1,}.+\s\r\n$/). Respect the original, reprint please indicate from: http://www.cnblogs.com/fsjohnhuang/p/4046856.html ^_^ Fat Boy John reference Http://blog. csdn.net/zhifeiyu2008/article/details/8829637 http://docs.oracle.com/javase/7/docs/technotes/guides/jar/ Jar.html
Http://www.cnblogs.com/fsjohnhuang/p/4046856.html
Java Magic Hall: the meta-inf/mainfest of packaging knowledge points. MF (RPM)