Nashorn

Oracle Nashorn is a JavaScript engine for the JVM developed in Java by Oracle. It was released with Java 8. It was created to provide developers with a highly efficiently and lightweight JavaScript runtime engine. Using this engine, developers were able to embed JavaScript code in their Java applications. Prior to Java 8, developers had access to the JavaScript engine created by Netscape. That engine, introduced in 1997, was maintained by Mozilla.

Nashorn can be used both as a command-line tool and as an embedded interpreter in Java applications. Let's look at examples of both.

Nashorn is the German word for rhinoceros. The name spawned from the Rhino-named JavaScript engine from the Mozilla Foundation. Rhino is said to have originated ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.