JDK-8263650 : Re-examine JAR index support
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2021-03-16
  • Updated: 2021-03-16
Description
JAR indexing is a legacy feature of the JAR file specification that was introduced as an optimisation for applets and class paths with network locations. We toyed with dropping it in JDK 9 when adding modular JARs and multi-release JARs but decided to just leave it. This issue tracks looking at it again and see if the usages have any real benefit to code on the class path.
Comments
My own efforts at improving jar/zip have mostly ignored JAR indexing. The feature has not gotten a lot of love from other jar/zip maintainers either AFAIK. The feature *may* be useful for people with very long classpaths (the "10k jar file problem"). The java module system implicitly introduces an index from java package name to module, and can do so because of the split package prohibition. So if every jar file can be turned into a modular jar, performance problems associated with long classpaths largely go away. In the real world split packages are likely to prevent that from happening for many years. Placing jar file metadata into the jar file itself introduces a staleness problem - any tool that manipulates jar files may need to be made aware of the index and may need to regenerate it. If the index is always created as a "last step" during an application build process, this is not an issue. In the real world this may not be possible - a "last step" is an inherently anti-modular concept.
16-03-2021