On Windows, you can use / as the file separator in the classpath. For example, both of the following are allowed:
java -cp foo\bar.jar FooMain
java -cp foo/bar.jar FooMain
However, ClassLoaderExt::process_jar_manifest only recognizes the backslash character as file separator
https://github.com/openjdk/jdk/blob/55851a312baaea5af14c04fb1b436313fe0deac7/src/hotspot/share/classfile/classLoaderExt.cpp#L213
Therefore, if bar.jar has the following in its META-INF/MANIFEST.MF
Class-Path: lib.jar
When running with the following
java -cp foo/bar.jar -Xlog:clss+path=trace FooMain
The following warning is printed:
[0.042s][info][class,path] library (non-existent) = lib.jar
As a result, all classes loaded from lib.jar cannot be archived (with a message of "Unsupported location")
java -cp foo\bar.jar FooMain
java -cp foo/bar.jar FooMain
However, ClassLoaderExt::process_jar_manifest only recognizes the backslash character as file separator
https://github.com/openjdk/jdk/blob/55851a312baaea5af14c04fb1b436313fe0deac7/src/hotspot/share/classfile/classLoaderExt.cpp#L213
Therefore, if bar.jar has the following in its META-INF/MANIFEST.MF
Class-Path: lib.jar
When running with the following
java -cp foo/bar.jar -Xlog:clss+path=trace FooMain
The following warning is printed:
[0.042s][info][class,path] library (non-existent) = lib.jar
As a result, all classes loaded from lib.jar cannot be archived (with a message of "Unsupported location")
- links to
-
Commit(master) openjdk/jdk/89ca89cb
-
Review(master) openjdk/jdk/20924