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)
To start JShell, enter the jshell command on the command line. JDK 9 must be installed on your system. If your path doesn't include java-home/jdk-9/bin , start the tool from within that directory.
If you are trying to access jshell on Mac OS X and getting the following error(jshell: command not found) that means you have to configure the $JAVA_HOME/bin in your bash_profile. Note: To start jshell you must have java 9 installed on your system. This feature is added in java9 version.
To start Jshell, first we must have installed Java 9 then open terminal in Linux or command prompt in windows and type jshell. It will start jshell session and displays a welcome message to the console. To display a simple “Hello Java” message, write print command without creating class and hit enter.
jshell
is a part of JDK 10 and it's located in the %JAVA_HOME%\bin
folder on Windows.
Possible problems:
You installed JRE 10 only (instead of JDK 10). jshell
is NOT part of the JRE.
%JAVA_HOME%\bin
is not part of the PATH
system variable.
See also: Environment variables for java installation
ls [JAVA-INSTALLEDPATH]/bin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With