neo4j/javascript-plugin — comment on commit a2850900a6761b40963e17f0f9a54b88a40b3419
File:  line 0
By espeed:

There are two versions of Rhino -- Mozilla's and Sun's.

The Rhino script engine that Neo4j presently uses for traversals is
the one that's bundled in the JRE. This is Sun's version of Rhino, not
Mozilla's, and it is based on Rhino 1.6R2
(http://docs.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/#jsengine),
which is several years old. The current version of Rhino
is 1.7R3.

Sun's version of Rhino is stripped down and less performant than
Mozilla's. For example, Sun's doesn't compile scripts so it interprets
it each time, and it doesn't contain any of Mozilla's latest
optimizations.

But switching to Mozilla's Rhino is not as easy as including the
latest version in the POM because the bundled script engine doesn't
support it.

To use Mozilla's, you need to build and include the js-engine.jar
located here (http://java.net/projects/scripting/sources/svn/show/trunk/engines/javascript).
Unfortunately, this is not documented anywhere except in an old
newsgroup posting.

The java.net script engine is hardcoded for Rhino 1.6R7 and it's been
three years since it's last update. While this is more recent that the
Sun version bundled in the JRE, it might be a good idea to fork it and
mavenize it for current versions.

The js-engine.jar included in this plugin's lib directory is the Mozilla engine built from java.net.

To use Mozilla's version, you use the script engine named
"rhino-nonjdk" instead of the standard "javascript" engine.