19

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?

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
Alex Martian
  • 3,423
  • 7
  • 36
  • 71

2 Answers2

32

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"
Community
  • 1
  • 1
Ori Marko
  • 56,308
  • 23
  • 131
  • 233
0

You may also install Rhino, see note on https://jmeter.apache.org/changes.html#Known%20problems%20and%20workarounds

Johan
  • 21
  • 3