运行环境:
- macOS Hight Sierra(Version 10.13.6)
- Terminal(oh my zsh)
下载安装JRE
Download URL
下载安装JDK
Download URL
- 配置JAVA_HOME
- 打开Terminal
- vim .bash_profile
- export JAVA_HOME=$(/usr/libexec/java_home)
- source .bash_profile
- echo $JAVA_HOME
- 添加$JAVA_HOME/bin到.bash_profile
- 打开Terminal
- vim .bash_profile
- export PATH=${JAVA_HOME}/bin:$PATH
- source .bash_profile
完成!
macOS Java安装与配置
原文:https://www.cnblogs.com/liushengchieh/p/9680845.html