java.scripting/com.sun.tools.script.shell.Main - JavaScript Shell

Q

How to run "java.scripting/com.sun.tools.script.shell.Main" tool from JDK lib\modules JImage file?

✍: FYIcenter

A

"java.scripting/com.sun.tools.script.shell.Main" tool allows you to start the Nashorn JavaScript shell.

"java.scripting/com.sun.tools.script.shell.Main" 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/com.sun.tools.script.shell.Main" 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/com.sun.tools.script.shell.Main

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

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

nashorn> 1+2;
3

nashorn> quit()

 

java.xml/com.sun.org.apache.xerces.internal.impl.xpath.regex.REUtil - Regular Expression Tool

java.base/sun.security.tools.keytool.Main - "keytool" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-10-18, 256👍, 0💬