Clone wiki

slime / jsh


jsh is a JavaScript environment for writing shell scripts. It runs on the Java virtual machine and requires at least Java 6 to be installed. (One recent release, jsh, has a bug that requires it to be running under a JDK, rather than merely a JRE, to start correctly.)

The following configurations are currently tested (note that "JDK" refers to Oracle's JDK):

Operating System Java version(s) JavaScript Engine(s) Browser(s) Native Launcher
Mac OS X 10.10 Oracle JDK 8u92 Rhino, Nashorn Safari 9.1.2, Google Chrome No
Windows 7 Oracle JDK 8u102 Rhino, Nashorn Internet Explorer 11 No
Linux (Ubuntu 16.04) OpenJDK 8u91 Rhino, Nashorn Firefox No

To install jsh, download the appropriate -setup.jar program from the Downloads page and execute it using java -jar jsh-[version]-setup.jar.

The installer installs a Rhino-based jsh. The Nashorn-based jsh can be used by setting the JSH_ENGINE environment variable to nashorn.

For the upcoming 0.0.5 release, a new installer is used that runs directly from the web. It can be invoked with:

jrunscript -e "load('')" <destination-directory>

0.0.5 represents the version to install, and is a bookmark corresponding to the latest 0.0.5 release candidate that has passed the verification suite. The version may be specified by a commit ID, bookmark, or tag.

Beginning with 0.0.5, it is also possible to run a jsh script without installing jsh using an experimental interface for that purpose. A script may be run with the following (experimental) command:

jrunscript -e "load('')" <script>

The name 0.0.5 is a version (commit, bookmark, or tag). <script> may be a local filename or a URL.