graaljs
graaljs copied to clipboard
URLClassLoader and GraalVM
I wrote a Driver which is using GraalVM JS. The driver is loaded into an application using URLClassLoader. This line of code from the driver is getting an exception
Context.newBuilder("js").allowAllAccess(true).build();
exception
No language and polyglot implementation was found on the classpath. Make sure the truffle-api.jar is on the classpath.
I tried also
Context.newBuilder("js").hostClassLoader(urlClassLoader).allowHostClassLoading(true).allowAllAccess(true).build();
and didn't work
In Gradle.properties I use :
implementation 'org.graalvm.js:js:22.2.0'
implementation 'org.graalvm.js:js-scriptengine:22.2.0'
and tried also
implementation "org.graalvm.sdk:graal-sdk:22.0.0.2"
implementation "org.graalvm.truffle:truffle-api:22.0.0.2"
I checked, and the truffle.jar is in passed to the URLCLassLoader. How can I fix this?
Hi, could you please share a reproducer code for this?
Duplicates https://github.com/oracle/graal/issues/4814