jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider - "jshell" Command


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

✍: FYIcenter


"jshell" command allows you to run JShell interactively.

"jshell" command is supported by the jmods\jdk.jshell.jmod module file, which is also linked into the lib\modules JImage file.

You can run the "jshell" command using the lib\modules JImage file as described below:

fyicenter> %JDK_HOME%\bin\java --module jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider

|  Welcome to JShell -- Version 11.0.1
|  For an introduction type: /help intro

jshell> System.out.println("Hello world!");
Hello world!

jshell> 1+2;
$1 ==> 3

jshell> Ctrl-D


jdk.jstatd/sun.tools.jstatd.Jstatd - "jstatd" Command

jdk.jlink/jdk.tools.jmod.Main - "jmod" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-05-14, 1602🔥, 0💬