Reputation: 2879
My purpose is to have a JSR-223 javascript engine available in the AdaptOpenJDK 8 VM.
So i thought to use the already familiar Rhino.
The OpenJDK wiki document here
https://wiki.openjdk.java.net/display/Nashorn/Using+Rhino+JSR-223+engine+with+JDK8
It specifies the place where to download Mozilla Rhino. here:
https://github.com/mozilla/rhino
And specifies there to download the jsr-223 script-engine wrapper. here:
https://java.net/projects/Scripting
But this link is dead.
Where can i can find the JSR-223 wrapper for Rhino?
Or maybe there is a better alternative available as JSR-223 javascript-engine.
Upvotes: 2
Views: 1493
Reputation: 957
I had exactly the same problem and actually manged to found the lost https://java.net/projects/Scripting project.
Here is a GitHub mirror: https://github.com/scijava/javax-scripting. The comment says that this is the final state of that repo, not sure if this is true.
That repo also has a few clones. I found one particularly useful, as it has JDK8 compatible JSR223 implementation for Rhino: https://github.com/zeroboo/java-scripting-rhino-jdk8.
While above are very handy if you need provide backward compatibility with Rhino, for a new project I would rather use GrallVM or Nashorn (note: already deprecated). JSR223 bindings are available for both out of the box: graal.js, nashorn.
Upvotes: 2
Reputation: 2879
Thanks for the comments. That's good news, that AdoptOpenJDK 8 comes with 'Oracle Nashorn' ! :)
c:/> Java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_192-b12)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.192-b12, mixed mode
My test app shows a listing of the available JSR-223 engines: Available script engines:
-------------------------------------------
Language: ECMAScript
Engine: Oracle Nashorn
Names: nashorn,Nashorn,js,JS,JavaScript,javascript,ECMAScript,ecmascript
-------------------------------------------
Instantiating it i see:
Name: Oracle Nashorn (version: 1.8.0_192)
Upvotes: 0