jjs command, like this:
jjs -scripting myscript.js
In this example, the
Alternatively, you can use the
-cp option to specify the classpath and include the Nashorn jar file, like this:
jjs -cp $JAVA_HOME/lib/nashorn.jar myscript.js
In this example, the Nashorn jar file is added to the classpath using the
-cp option, and the
myscript.js script is executed using the Nashorn engine.
jjs command and its options, refer to the Nashorn documentation.