RFR 8216401 : Allow "file:" URLs in Class-Path of local JARs

Brent Christian brent.christian at oracle.com
Fri Jan 11 18:35:00 UTC 2019


Please review my change for 8216401[1].


The Class-Path section of the JAR spec[2] states that entries must be 
relative URLs, however this hasn't been enforced for most of Java's 
history.  There is now code to enforce this, though it is disabled by 
default for compatibility.

It has come to light that there are some widely-used libraries that 
misuse the Class-Path attribute, by including absolute "file:" URL 
entries.  In the interest of compatibility with this long-standing 
behavior, "file:" entries in the Class-Path of JARs loaded from the 
local disk should be allowed.

This change will not affect the current default behavior, but hopefully 
in the near future, the Class-Path enforcement code can be enabled by 
default, and the change be reflected in the JAR spec[3].

Automated build+test passes cleanly.


1. https://bugs.openjdk.java.net/browse/JDK-8216401

3. https://bugs.openjdk.java.net/browse/JDK-8211941

More information about the core-libs-dev mailing list