Why would I want to use Rhino 22.214.171.124?
But maybe you have some technical reason why you prefer Mozilla's Rhino which has some special functionalities that are not in Nashorn.
How do I use it?
The code is a Maven project.
In your project, add rhino-js-engine as a dependency:
<dependency> <groupId>cat.inspiracio</groupId> <artifactId>rhino-js-engine</artifactId> <version>126.96.36.199</version> </dependency>
You don't need to add Rhino itself since it is pulled in by rhino-js-engine.
In your java code, get the scripting engine called "rhino":
import javax.script.*; ScriptEngineManager manager=new ScriptEngineManager(); ScriptEngine engine=manager.getEngineByName("rhino");
Now you can call the script engine methods: