Mozilla Rhino based JSR-223 (javax.script) engine has been removed in Oracle's JDK8 implementation. But OpenJDK8 and Oracle JDK8 implementation have nashorn replacement. But, to have time to migrate your JavaScript code to nashorn, you may want to stick to Rhino based jsr-223 implementation on jdk8 (as interim solution). If so, this document is for you.
Clone Rhino source code from this git repo, into "$rhino_dir"
https://github.com/mozilla/rhino
Use ant to build js.jar
$rhino_dir/build/rhino1_7R5pre/js.jar
If you want to get pre-built binary instead, you can download from here:
https://developer.mozilla.org/en-US/docs/Rhino/Download_Rhino
https://github.com/downloads/mozilla/rhino/rhino1_7R4.zip
In either way, you'd get js.jar file in this step.
JSR-223 engine over Rhino is available from java.net scripting project. You can get the sources and build it using these steps:
The above step result in $scripting/trunk/engines/javascript/build/js-engine.jar
You've two jars now: js.jar and js-engine.jar. You can put these two jars in your CLASSPATH. When creating script engine in your app, you need to use "rhino" as engine name.
You can also use jrunscript" in jdk8 along with this rhino based script engine:
jrunscript -cp js-engine.jar:js.jar -l rhino |