1.配置環(huán)境變量
1.打開mac
終端:command
+空格鍵
--彈出搜索框輸入terminal.app
2.如果你是第一次配置環(huán)境變量趁啸,可以使用touch .bash_profile
創(chuàng)建一個(gè).bash_profile
的隱藏配置文件(如果你是為編輯已存在的配置文件且叁,則使用open -e .bash_profile
命令)
3.輸入open -e .bash_profile
命令
2.新建配置文件.bash_profile
并打開
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
export JAVA_HOME
export PATH=$PATH:$JAVA_HOME
3.新建配置文件 .zshrc
并打開
source ~/.bash_profile
4.命令行刷新配置
source ~/.bash_profile
source ~/.zshrc