Why Java’s Nashorn Engine Is Being Removed in JDK 15 (JEP 372 Explained)
Oracle’s Jim Laskey proposes JEP 372 to drop the Nashorn JavaScript engine and its APIs from the JDK, detailing the modules to be removed, the impact on javax.script, and community reactions including a shift toward GraalVM.
Oracle software R&D director Jim Laskey has put forward JEP 372, a candidate Java Enhancement Proposal that aims to remove the long‑standing Nashorn JavaScript engine, its related APIs, and the jjs tool. This is the first JEP to enter the candidate stage in 2020 and is considered mature enough for inclusion in JDK 15.
JEP 372 (JEP 372) states that the Nashorn engine was originally integrated into JDK 8 via JEP 174 to replace the Rhino script engine, providing a full implementation of the ECMAScript‑262 5.1 standard. Over time, the rapid evolution of ECMAScript and its APIs made Nashorn difficult to maintain.
The proposal specifies that two JDK modules will be permanently removed: jdk.scripting.nashorn: contains jdk.nashorn.api.scripting and
jdk.nashorn.api.tree jdk.scripting.nashorn.shell: contains the jjs tool
This deprecation will not affect the javax.script API in any way.
When Nashorn was released, its performance was 2–10 times better than the previous Rhino implementation, which contributed to its wide adoption.
However, Nashorn was already deprecated in JDK 11 (JEP 335). JEP 372 argues that enough time has passed for developers to migrate away from it.
Developers have mixed opinions: some argue that Java’s strong backward‑compatibility should prevent removal, others criticize continued use of Rhino, and some recommend switching directly to GraalVM for a more complete and faster JavaScript/Node implementation.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Programmer DD
A tinkering programmer and author of "Spring Cloud Microservices in Action"
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
