I understood the answer by reading the source code of hotspot.
Only paths passing through CLASSPATH
or -cp
/ -classpath
are subject to wildcard expansion. They are then passed as a system property to start the JVM through -Djava.class.path
.
You tell the JVM with the JNI call about the class path using the JVMOptions
structure, which may include -Djava.class.path
, but -classpath
will not necessarily execute (and in practice this is not an implementation of Hotspot). Since java.class.path
directly passed to the JVM as a system property, it does not decrypt the wildcard, and therefore the wildcard will not work.
source share