graaljs
graaljs copied to clipboard
Updated graalvm-ce-java11-22.2.0 could not find option
val context = Context.newBuilder()
.allowExperimentalOptions(true)
.allowPolyglotAccess(PolyglotAccess.ALL)
.allowHostAccess(HostAccess.ALL)
.allowAllAccess(true)
.allowHostClassLoading(true)
.allowHostClassLookup {
true
}
GraalJSScriptEngine.create(null, context)?.apply {
val bindings = getBindings(ScriptContext.ENGINE_SCOPE)
bindings["VERSION"] = "1.0"
eval(
"""
function run(){
return [1,2,3,4]
}
"""
)
// PolyglotMap
val ret = invokeFunction("run")
println(ret)
}
Exception in thread "main" java.lang.IllegalArgumentException: Could not find option with name js.script-engine-global-scope-import.
Hi, Thank you for reporting this, is that a Java code? could you please provide a complete reproducer code for this issue? preferably in a Github repo I can pull.
@oubidar-Abderrahim it kotlin coding ,It is compatible with Java ,Upgrade the new version. Graalvm sent this error ,Run normally with version 22.1.0
@oubidar-Abderrahim it kotlin coding ,It is compatible with Java ,Upgrade the new version. Graalvm sent this error ,Run normally with version 22.1.0
Check this manual
Since GraalVM 22.2, the JavaScript support is packaged in a separate GraalVM component. It can be installed with the GraalVM Updater:
$GRAALVM/bin/gu install js