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 in JDK 9, 10, and 11.

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

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\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, 1140👍, 0💬