In this example I start Rhino and press arrow-left, BackSpace and Enter:
$ rhino
Rhino 1.7 release 3 2012 02 13
js> 0987654321
98765431
js>
Rhino was installed by:
$ sudo apt-get install rhino
Rhino uses the built-in Java from Oracle, which I think is good since it saves space and time compared to downloading OpenJDK.
Rhino is a script that calls Java:
$ cat `which rhino`
Code: Select all
#!/bin/sh
JAVA_CMD="/usr/bin/java"
JAVA_OPTS=""
JAVA_CLASSPATH="/usr/share/java/js.jar:/usr/share/java/jline.jar"
JAVA_MAIN="org.mozilla.javascript.tools.shell.Main"
##
## Remove bootclasspath overriding for OpenJDK since
## it now use a mangled version of Rhino (in sun.org.mozilla.rhino package)
##
## References:
## <https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/255149>
## <http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=179>
## <http://www.openoffice.org/issues/show_bug.cgi?id=91641>
##
$JAVA_CMD $JAVA_OPTS -classpath $JAVA_CLASSPATH $JAVA_MAIN "$@"