Using Rhino JSR-223 engine with JDK8
Step 1 get Rhino
Clone Rhino source code from this git repo, into "$rhino_dir"
Use ant to build js.jar
If you want to get pre-built binary instead, you can download from here:
In either way, you'd get js.jar file in this step.
Step 2 get JSR-223 script engine on Rhino
JSR-223 engine over Rhino is available from java.net scripting project. You can get the sources and build it using these steps:
- svn checkout https://java.net/projects/Scripting
- drop Rhino js.jar into the above dir
- cd ../make
- ant clean all
Using Rhino JSR-223 engine
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: