Goals of Nashorn
Laskey described his goals for Nashorn as follows:
- Nashorn will be based on the ECMAScript-262 Edition 5.1 language specification and must pass the ECMAScript-262 compliance tests.
- Nashorn will support the
javax.script(JSR 223) API.
- Nashorn will define a new command-line tool,
- Performance and memory usage of Nashorn applications should be significantly better than Rhino.
- Nashorn will not expose any additional security risks.
- Supplied libraries should function correctly under localization.
- Error messages and documentation will be internationalized.
Laskey also explicitly limited the scope of the project with some "non-goals":
- Nashorn will not include a browser plug-in API.
- Nashorn will not include support for DOM/CSS or any related libraries (such as jQuery, Prototype, or Dojo).
- Nashorn will not include direct debugging support.
So what does it mean to be based on ECMAScript-262 Edition 5.1? The differentiator here is that Rhino was based on the older, less capable Edition 3. The
Nashorn command-line tools
After reading about
jjs, I was eager to try out the shell on my iMac, but after installing Java 8 it wasn't available to the bash shell. It turns out the documentation and implementation weren't completely in sync.
I knew the installation had been successful:
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
-bash: jjs: command not found. A little poking around brought me to the
There I found something called
jrunscript, which turned out to be a variant of
jjs that runs an extra startup script. That should have satisfied me, but I was puzzled as to why the documented
jjs tool wasn't installed in
/usr/bin/ with the rest of the Java 8 runtime. A little research led me to look at the JavaVirtualMachines installation for Java 8. On a Mac, look for
You can define an alias for
jjs in the latter directory and add it to your shell configuration if you need it for scripting on a Mac or Linux. On a PC, you can add the correct
jre/bin/ directory to your PATH. In his video from the Java 8 launch, Jim Laskey suggests copying
jjs to the
/usr/bin/ directory, but when I did that I found that
jjs couldn't find the
jre properly at runtime.
Having trouble installing and setting up Win10? You aren’t alone. Here are many of the most common...
Win7 Update scans got you fuming? Here’s how to make the most of Microsoft’s 'magic' speed-up patch
Picking an Android phone can be difficult, but we're here to help. These are the top Android phones you...
SaltStack Enterprise 5.0 draws on high-speed messaging for superior scalability and control, but the...
With a scattershot set of improvements, the new Android version is a fairly minor affair, but there’s...
Miss Yahoo Pipes? Microsoft's low-code tool for application mashups does a better job in meeting...
The programming community's survey also finds that many developers are newcomers to the field