JEP 335: Deprecate the Nashorn JavaScript Engine

July 17, 2019 | 2 minute read
Text Size 100%:

Download a PDF of this article

This proposal, made in May 2018, puts forth the idea of deprecating the engine added in Java 8 that provides application users a way to script inside Java apps. In this way, Nashorn (pronounced “nas-horn”) provides functionality similar to what Lua provides to C programs.

You might recall that Nashorn was added to Java 8 as a replacement for its slower predecessor, the Rhino engine. Both products are implementations of the Java scripting interface, which defines a mechanism that enables scripting and specifies how data is moved between the engine and the host Java application. Although Nashorn and Rhino support JavaScript, scripting engines exist for other languages, such as Groovy and Ruby.

JEP 335 does not propose deprecating the scripting engine technology, but rather just the JavaScript implementation. The primary driver is that JavaScript itself is evolving, and to provide full support for the language requires considerable developer resources for apps that might not even need the new features. To wit, Nashorn currently supports the ECMAScript version 5.1. However, ECMAScript 2016 and 2017 await implementation.

JEP 335 currently is only a proposal. According to the authors, part of the rationale for this proposal is to see whether developers outside of Oracle might be interested in working on Nashorn. In any event, all code that presently works with Nashorn would continue to do so for the foreseeable future. More on the status of JEP 335 will be posted as comments are received.

All current and former JEPs can be found on the Oracle Open JDK site.

[Update: Nashorn has been deprecated and will no longer be updated or bundled with the JDK.]

Java Magazine Staff

Java Magazine staff (javamag_us@oracle.com, @Oraclejavamag) deliver authoritative information about Java, the JVM, and JVM languages to a community of more than one-quarter million developers.


Previous Post

JEP 296: Consolidate the JDK Sources into a Single Repository

Java Magazine Staff | 1 min read

Next Post


JEP 343: Packaging Tool for Self-Contained Java Apps

Java Magazine Staff | 1 min read