jjs tool might soon be deprecated, according to JEP 335.
Here’s the motivation behind JEP 335:
When it was released, it was a complete implementation of the ECMAScript-262 5.1 standard.
With the rapid pace at which ECMAScript language constructs, along with APIs, are adapted and modified, we have found Nashorn challenging to maintain.
While it personally saddens me to see #Nashorn go, it’s understandable – keeping the pace is hard with a small team, and #GraalVM‘s JS implementation is definitely fast. #Nashorn paved part of the way.
— Michael Haupt (@haupz) June 6, 2018
However, this deprecation will not affect the
Nashorn is just one of the three JDK modules that will be terminally deprecated, therefore it is annotated with
jdk.scripting.nashorn— contains the
jdk.scripting.nashorn.shell— contains the
jjswill display a warning:Warning: The jjs tool is planned to be removed from a future JDK release.
jdk.dynalink— contains the Dynalink support library.
Note: A separate JEP will be filed for the actual removal of the types and modules in a future JDK feature release.
So what should you use now?
A viable alternative seems to be GraalJS, which uses Oracle Labs’ Truffle technology and may soon be publicly available as a Java module. Since GraalJS offers most of the same functionality as Nashorn but with better performance, you should probably look into it.
If you’re using Nashorn, you should give them feedback – this will provide better insight into actual Nashorn usage.