Summary
-------
Nashorn script engine along with its exported APIs and nashorn shell command line tool "jjs" are deprecated for removal.
Problem
-------
The Nashorn JavaScript engine was first incorporated into JDK 8 via JEP 174 as a replacement for the Rhino scripting engine. 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.
See also: http://openjdk.java.net/jeps/335
Solution
--------
Deprecate the Nashorn JavaScript script engine and APIs, and the jjs tool, with the intent to remove them in a future release.
Specification
-------------
Deprecated annotation:
Nashorn module 'jdk.scripting.nashorn' exports two API packages:
jdk.nashorn.api.scripting;
jdk.nashorn.api.tree;
@Deprecated(forRemoval=true) annotation will be added to the module-info.java file for jdk.scripting.nashorn module and its exported packages mentioned above as well as all the public Java types of those exported API packages.
Both jjs shell and nashorn programmatic use via javax.script API will result in a warning about deprecation being printed at the standard error.
"Warning: The jjs tool is planned to be removed from a future JDK release"
"Warning: Nashorn engine is planned to be removed from a future JDK release"
To minimize compatibility issues for the third-party tools, libraries which may be depend on nashorn engine/shell output, the warning message can be suppressed using a new command line option.
The specification for the new command line option is as follows:
--no-deprecation-warning (Do not show nashorn deprecation warning.)
param: [true|false] default: false