Nashorn is deprecated as of Java 11
InfoWorld states: Oracle: Switch now from Nashorn JavaScript engine to GraalVM:
"Oracle cited multiple advantages GraalVM has over Nashorn:"
- "A more complete implementation of JavaScript standards, with support for the ECMAScript 2016 and ECMAScript 2017 editions and some support for ECMAScript 2018."
- "Full support for the Node.js server-side JavaScript platform, which is compatibie with almost all Node.js modules."
- "The ability to execute additional languages including Python, R, and Ruby."
- "Better performance than existing JVM-based engines and ability to use the GraalVM compiler’s advanced optimizations."
"To help developers migrate from Nashorn to GraalVM, Oracle Labs has added a compatibility flag (—nashorn-compat) that removes the need for tedious rewrites to move a Nashorn application to GraalVM"