It also defines main attributes that apply to every individual manifest entry. The main section contains security and configuration information about the JAR file itself, as well as the application. They each have their own specific restrictions and rules. Both the main section and individual sections follow the section syntax specified above. JAR Manifest OverviewĪ JAR file manifest consists of a main section followed by a list of sections for individual JAR file entries, each separated by a newline. Non-terminal symbols defined in the above specification will be referenced in the following specifications. header will start with the four letters "From". Also: To prevent mangling of files sent via straight e-mail, no Otherchar: any UTF-8 character except NUL, CR and LF Value: SPACE * otherchar newline *continuation Newline: CR LF | LF | CR ( not followed by LF) Implementations shall support header values of up to 65535 bytes.Īll the specifications in this document use the same grammar in which terminal symbols are shown in fixed width font and non-terminal symbols are shown in italic type face. Examples of binary data are digests and signatures. Continuations are required for binary data which causes line length to exceed 72 bytes. Sections are separated from other sections by empty lines.īinary data of any form is represented as base64. Groups of name-value pairs are known as a "section". We also call these pairs headers or attributes. In most cases, information contained within the manifest file and signature files is represented as so-called "name: value" pairs inspired by the RFC822 standard. Name-Value pairs and Sectionsīefore we go to the details of the contents of the individual configuration files, some format convention needs to be defined. This directory stores all the service provider configuration files. This file stores the digital signature of the corresponding signature file. The signature block file associated with the signature file with the same base file name. It is part of the JarIndex implementation and used by class loaders to speed up their class loading process. This file is generated by the new " -i" option of the jar tool, which contains location information for packages defined in an application. The manifest file that is used to define package related data. The following files/directories in the META-INF directory are recognized and interpreted by the Java 2 Platform to configure applications, class loaders and services: On the other hand, JAR files on the class path use the META-INF directory for security, versioning, or service configuration. JAR files that are deployed as modules declare (explicitly or implicitly) their dependences and may declare service providers too. The module name for an automatic module is derived from the name of the JAR file and its exported packages are determined by the. If the JAR file does not have a module-info.class in the top-level directory then it is considered to be an automatic module. The module-info.class file is the binary form of the module declaration. If the JAR file has a module-info.class in the top-level directory then it is a Modular JAR file. The META-INF directory, if it exists, is used to store package and extension configuration data, including security, versioning, and services deployed on the module path, as opposed to the class path, are modules. They are used as building blocks for applications. JAR files that are not just simple archives of java classes files and/or resources. There is no restriction on the name of a JAR file, it can be any legal file name on a particular platform. A JAR file can be created by the command-line jar tool, or by using the API in the Java platform.
#Path to java jar file zip file
A JAR file is essentially a zip file that contains an optional META-INF directory. JAR file is a file format based on the popular ZIP file format and is used for aggregating many files into one. Copyright © 2017 Oracle and/or its affiliates