Class-Path (in jar file) semantics different between Java 11 and 13 (on Windows)?
Alan Bateman
Alan.Bateman at oracle.com
Tue Nov 19 20:48:48 UTC 2019
On 19/11/2019 20:22, David Lloyd wrote:
> :
> Where can the updated specification be found? It has in the past been
> clearly specified and well understood that class path entries are
> interpreted as relative URLs. If that has changed then this will
> definitely break Quarkus and perhaps other applications as well.
>
> A Google search for "JAR file specification" only seems to turn up
> older versions (JDK 10 and earlier).
One way to quickly get to it is type "java.util.jar" into the javadoc
search box and it is linked from the package description. So for the JDK
13 published on jdk.java.net it is:
https://docs.oracle.com/en/java/javase/13/docs/specs/jar/jar.html#class-path-attribute
The value is a relative URL, same as always, it's just that the
implementation is less tolerant of bad input. The stricter checking has
been in place for a few releases, controlled by the system property
mentioned in the discussion here.
It's always hard to dial up checking after the fact and one of the main
challenges has been mis-uses where tools have been putting file paths
(rather than URL) or absolute URLs into the value. This is the reason
why the spec now allows absolute file URLs (need to specify the "file:"
scheme).
-Alan
More information about the core-libs-dev
mailing list