When I run JMeter 5.1.1 recently downloaded, I see many times in terminal window
:
Warning: Nashorn engine is planned to be removed from a future JDK release
I've used web search and found JEP 335: Deprecate the Nashorn JavaScript Engine.
Motivation
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.
I expected to read that new engine is now in more use, but no, I could not find what will run JavaScript
in replacement. What would happen with JavaScript
in JMeter
? It will not run and we use encouraged to use Groovy
?
BTW, how to remove that warning from terminal?
Nashorn is a JavaScript engine that was removed effective with Oracle Java 15. Most likely it's being pulled in by one of your document-processing libaries. Odds are that it's Batik, pdfbox or poi. You might want to use the Maven dependencies display tool to see if you can find the connection.
The Nashorn engine has been deprecated in JDK 11 as part of JEP 335 and and has been removed from JDK15 as part of JEP 372. GraalVM can step in as a replacement for JavaScript code previously executed on the Nashorn engine. GraalVM provides all the features for JavaScript previously provided by Nashorn.
With the release of Java 11, Nashorn was deprecated citing challenges to maintenance, and has been removed from JDK 15 onwards. Nashorn development continues on GitHub as a standalone OpenJDK project and the separate release can be used in Java project from Java 11 and up.
Nashorn is a JavaScript engine. It is used to execute JavaScript code dynamically at JVM (Java Virtual Machine). Java provides a command-line tool jjs which is used to execute JavaScript code. You can execute JavaScript code by using jjs command-line tool and by embedding into Java source code.
Groovy is encouraged in JMeter's best practices
We advise using Apache Groovy
In new version changes there's a workaround for this warning:
To silence these warnings, add -Dnashorn.args=--no-deprecation-warning to your Java arguments. That can be achieved by setting the enviroment variable JVM_ARGS
export JVM_ARGS="-Dnashorn.args=--no-deprecation-warning"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With