with any later version (tested with 22.3.3, 23.0.2 and 24.0.1), I get this:
$ /Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.3.3/Contents/Home/bin/js --version
GraalVM JavaScript (GraalVM CE Native 22.3.3)
$ /Library/Java/JavaVirtualMachines/graalvm-ce-java17-22.3.3/Contents/Home/bin/js --jvm "--vm.cp=/tmp/jackson/*" --vm.Dpolyglot.js.load-from-classpath=true --vm.Dpolyglot.js.load-from-url=true
> Java.type("com.fasterxml.jackson.core.JsonParser")
TypeError: Access to host class com.fasterxml.jackson.core.JsonParser is not allowed or does not exist.
at <js> :program(<shell>:1:1:0-49)
Java.addToClasspath() with a wildcard does not work either:
> Java.addToClasspath("/tmp/jackson/*")
> Java.type("com.fasterxml.jackson.core.JsonParser")
TypeError: Access to host class com.fasterxml.jackson.core.JsonParser is not allowed or does not exist.
at <js> :program(<shell>:3:1:0-49)
It does not seem to be a problem with GraalVM in general because when printing out the java.class.path in a Java program, it still gets expanded (the program simply prints java.lang.System.getProperty("java.class.path")):
It seems that since GraalJS 22.x, wildcards in the classpath do not work anymore.
Before (21.x), I got this behavior:
with any later version (tested with 22.3.3, 23.0.2 and 24.0.1), I get this:
Java.addToClasspath()
with a wildcard does not work either:However, listing the jar files explicitly works:
It seems that before 22.x, the wildcard was expanded at some point:
After 22.x, the wildcard appears in the classpath as-is:
It does not seem to be a problem with GraalVM in general because when printing out the
java.class.path
in a Java program, it still gets expanded (the program simply printsjava.lang.System.getProperty("java.class.path")
):