'jshell' is not recognized as an internal or external command

Kannan Thangadurai picture Kannan Thangadurai · Mar 26, 2018 · Viewed 10.6k times · Source

I am using the 'jshell command in my machine it is not recognised. But java command is working fine. is there any environment setup for jshell in jdk 10

C:\Users\Kannan
λ jshell
'jshell' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Kannan
λ java -version
java version "10" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10+46)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

Answer

Alex Shesterov picture Alex Shesterov · Mar 26, 2018

jshell is a part of JDK 10 and it's located in the %JAVA_HOME%\bin folder on Windows.

Possible problems:

  1. You installed JRE 10 only (instead of JDK 10). jshell is NOT part of the JRE.

  2. %JAVA_HOME%\bin is not part of the PATH system variable.

See also: Environment variables for java installation