Swiftness
Swiftness

Reputation: 13

Using Nashorn API. Got 'Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0'

I used Nashorn API to use JavaScript code module with Java.

ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("nashorn");

Just like this. But I got this error:

Execution failed for task ':Main.main()'.

> Process 'command '/Users/user/Library/Java/JavaVirtualMachines/openjdk-19.0.1/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:

> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
> Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
> You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
> For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
> BUILD FAILED in 269ms
> 2 actionable tasks: 1 executed, 1 up-to-date

I've already searched about it, but no one said this error is related to Nashorn.

I know that Nashorn is deprecated, so I'm using OpenJDK's version. And I've tried switching to rhino or graal.js but the result was same.

Is there any way to use JavaScript with Gradle without deprecation warning?

Upvotes: 0

Views: 100

Answers (0)

Related Questions