Since nobody mentioned it: Since Java 1.6 The Java JDK also comes bundled with a JavaScript commandline and REPL.
It is based on Rhino: https://developer.mozilla.org/en/docs/Rhino
In Java 1.6 and 1.7 the command is called jrunscript
(jrunscript.exe
on Windows) and can be found in the bin folder of the JDK.
Starting from Java 1.8 there is bundled a new JavaScript implementation (Nashorn: https://blogs.oracle.com/nashorn/)
So in Java 1.8 the command is called jjs
(jjs.exe
on Windows)