Could not execute jshell from Mac terminal

I am currently using java 1.8 on my Mac Sierra.

java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

Now I want to run jshell to execute simple java commands directly from the terminal. But I got the following error message -

Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/jshell" (-1)

What workaround do I need to avoid this error message?

+4
source share
1 answer

As @Elliott pointed out , you need to download and install Java-9 to work with .

, /jdk../.../bin. jshell , .

enter image description here

+1

Source: https://habr.com/ru/post/1652937/


All Articles