1.配置环境变量
1.打开mac
终端:command
+空格键
--弹出搜索框输入terminal.app
2.如果你是第一次配置环境变量,可以使用touch .bash_profile
创建一个.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
网友评论