java.scripting/ - JavaScript Shell


How to run "java.scripting/" tool from JDK lib\modules JImage file?

✍: FYIcenter


"java.scripting/" tool allows you to start the Nashorn JavaScript shell.

"java.scripting/" tool is supported by the jmods\jdk.scripting.jmod module file, which is also linked into the lib\modules JImage file.

"java.scripting/" tool using the lib\modules JImage file as described below using JDK 17 as an example:

fyicenter> %JDK_HOME%\bin\java --module java.scripting/

script engine for language js can not be found

So there is no default JavaScript engine in JDK 17.

If you run the same command in JDK 11, you will get the Nashorn engine:

fyicenter> %JDK_HOME%\bin\java --module java.scripting/

Warning: Nashorn engine is planned to be removed from a future JDK release

nashorn> print("Hello world!");
Hello world!

nashorn> 1+2;

nashorn> quit()


java.xml/ - Regular Expression Tool

java.base/ - "keytool" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-10-18, 1581🔥, 0💬