JAR File Index Specification

Q

What is the JAR file index specification? What tools can I use to generate the index file?

✍: FYIcenter.com

A

The index file of a JAR file contains directory information as to which classes and resources reside in the JAR file. The index file is stored as META-INF/INDEX.LIST in the JAR file.

The index file specification is given below:

    index file :     version-info blankline section*
    version-info :   JarIndex-Version: version-number
    version-number : digit+{.digit+}*
    section :        body blankline
    body :           header name*
    header :         char+.jar newline
    name :           char+ newline
    char :           any valid Unicode character except NULL, CR andLF
    blankline:       newline newline
    newline :        CR LF | LF | CR (not followed by LF)
    digit:           {0-9}

Here is a sample of a JAR index file, INDEX.LIST:

JarIndex-Version: 1.0

activation.jar
META-INF
javax
javax/activation
com
com/sun
com/sun/activation
com/sun/activation/registries
com/sun/activation/viewers

Back to FAQ on JAR (Java ARchive) File Format.

2016-04-12, 2515🔥, 0💬