I installed Jdk9 on MAC OSX, and I added the JDK path to bash_profile. When I use the jshell command from the terminal, I get a "Command not found" error. I can get the correct version number when I type the command java -version.
java -version
How do I access jshell from terminal? Do I need to include the jdk 9 bin folder path in bash_profile?
bash_profile
Yes. All you have to do is configure in the bash_profile file, which can be done as: $JAVA_HOME/bin
$JAVA_HOME/bin
and then confirm the java version at your prompt.
PS : all other variables in bash_profileexcept JAVA_HOMEand PATHin the profile can be ignored.
JAVA_HOME
PATH
JDK-9 PATH.
export PATH=/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin:$PATH jshell | Welcome to JShell -- Version 9.0.1 | For an introduction type: /help intro jshell>
.bash_profile
export PATH=$PATH:/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin
jshell .
jshell
/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin $PATH, /, /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin
/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin
$PATH
$PATH -
echo $PATH , , $PATH.
echo $PATH
directory= , $PATH
directory
PATH=directory:$PATH
PATH=$PATH:directory
Source: https://habr.com/ru/post/1686243/More articles:Julia - why loops are faster - performanceBizTalk 2016: using an HTTP token adapter with an API token - biztalkHDF5: составной тип данных для записи структуры, содержащей указатель на другую структуру - cOverlay permission error on API 26 - androidhow to enable api gateway logs through cloud formation template (serverless.yml)? - lambdaHow to add JavaFX stylesheet from another module in Java 9? - javaHow to get ResourceBundle from another module in Java 9? - javaMySql search timestamp based on timezone offset - mysqlObject database migration does not handle migration ALTER TABLE - androidDotnet web core performance testing - performance-testingAll Articles