My desktop app use the ScriptEngine
to do something,which I know ScriptEngine
is removed after jdk11.
So I add an dependency of this
implementation("org.openjdk.nashorn:nashorn-core:15.3")
and some example code,like this
val engine = manager.getEngineByName("javascript")
val hookJscode = """
function test(){
return 10;
}
"""
engine.eval(hookJscode)
val result = engine.eval("test()")
println(reslut.toString())
It’s ok when I run the jar,but is is fail when I run the dmg which I distribute.
The tip message is follow picture
enter image description here
I don’t know what happen,is there someone can help me,thanks?
by the way,I use the openjdk 18 of zulu to distribute dmg.And I distribute to msi to window system,it’s also ok.
hope the dmg can run success