Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

JavascriptValidator - Nashorn Engine deprecation #462

Open
dbluhm opened this issue Aug 25, 2020 · 2 comments
Open

JavascriptValidator - Nashorn Engine deprecation #462

dbluhm opened this issue Aug 25, 2020 · 2 comments

Comments

@dbluhm
Copy link

dbluhm commented Aug 25, 2020

This is a distant issue that we likely will not have to worry about for some time but I figured it was worth documenting formally and getting some of my research on the topic written down.

As per JEP 372, the Nashorn Javascript engine has been removed from Java 15 onward. The Nashorn engine is marked as deprecated starting with Java 11, causing warnings like the following to be raised periodically when using the JavascriptValidator:

Warning: Nashorn engine is planned to be removed from a future JDK release

In Nashorn's impending absence, GraalVM seems to be the most widely supported replacement. There are some quirks, however, that may make it difficult to adopt GraalVM. The recommended migration path involves replacing the standard OpenJDK VM with Graal's VM (as detailed in this blog post from GraalVM) but a less performant setup using the stock JDK is also available. From my relatively light research, our use case may not even take advantage of the features provided by Graal's alternate VM anyways, potentially making the choice clearer.

To this point, I don't believe there has been any discussion about moving to newer versions of Java so, again, this may be a non-issue for the foreseeable future. That being said, an alternate JS engine may also be valuable for potential performance gains so this may be a desirable path to take even before migrating to newer versions of Java.

@jayjaybillings
Copy link
Member

Based on an article I pulled up, Oracle recommends using GraalVM as a module in Java 11. There should be no need to replace the OpenJDK vm entirely.

https://www.infoworld.com/article/3291322/oracle-switch-now-from-nashorn-javascript-engine-to-graalvm.html

@jayjaybillings
Copy link
Member

We should probably figure this out for the 3.0 release since Java 15 is out and does not have Nashorn.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants