Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8302819

Remove JAR Index

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 21
    • None
    • core-libs

    Description

      JAR Index is a legacy optimization from early JDK releases to allow downloading of JAR files to be postponed when loading applets or other classes over the network. It is specified in the JAR file spec. JAR Index doesn't interact well with other features and has several long standing issues. Some examples:

      - The JAR index file (META-INF/INDEX.LIST) is ignored in modular JARs.

      - The JAR index is not reliable when be used with Multi-Release JAR files, e.g. when the versioned section has classes/resources in "new packages".

      - URLClassLoader::findResources does not locate resources in more than one JAR file when a JAR index is present.

      - JarInputStream::getManifest can not return the Manifest because the index is stored as the first entry in the JAR file.

      We had hoped to deprecate or remove JAR Index in Java 9 but didn't get to it. In JDK 18, the support at runtime to ignore JAR index files by default with a system property to re-enable if needed. There has been no feedback on this change.

      It is time to remove the JAR Index feature. Removing this feature means:

      - Removing the JAR Index section from the JAR file spec or changing it document it as a historical feature.

      - The jar -i (--generate-index=FILE) option can continue to generate the JAR index or the option can be changed to just emit a warning.

      - The system property jdk.net.URLClassPath.enableJarIndex can be removed.

      Attachments

        Issue Links

          Activity

            People

              eirbjo Eirik Bjørsnøs
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: