jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main - "jjs" Command


How to run "jjs" command from JDK lib\modules JImage file?

✍: FYIcenter


"jjs" command allows you to run the Nashorn JavaScript Engine interactively.

"jjs" command is supported by the jmods\jdk.scripting.nashorn.shell.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "jjs" command 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 jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main

Warning: The jjs tool is planned to be removed from a future JDK release
jjs> print('Hello World!');
Hello World!
jjs> 1+2
jjs> quit()


⇒ jdk.security.auth/com.sun.security.auth.module.Crypt - Crypt Tool

⇐ jdk.scripting.nashorn/jdk.nashorn.tools.Shell - JavaScript Shell Tool

⇑ Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-05-14, 1095👍, 0💬