进入home目录

cd ~

修改.zprofile文件

vi .zprofile

按i进入vim插入模式,添加以下代码

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home"
export PATH="$PATH:$JAVA_HOME/bin"

键入:wq保存并退出vim

 

其中JAVA_HOME要对应自己电脑上安装的位置

 

执行source .zprofile

source .zprofile

 

MacOS上zsh环境设置默认jdk

 

相关文章:

  • 2021-08-03
  • 2022-02-20
  • 2021-11-27
  • 2021-05-11
  • 2022-12-23
  • 2021-12-18
  • 2021-10-18
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
相关资源
相似解决方案