原因:是因为Mac已经废弃zsh,不用.bash_profile了。要用.zprofile
配置步骤:
1、打开终端:cd ~/
2、创建.zprofile文件, 是一个隐藏文件了的
3、写入下面代码。直接复制就好
JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
PATH=$JAVA_HOME/bin:$PATH:
export JAVA_HOME
export CLASSPATH
export PATH
export PATH=${PATH}:~/Library/Android/sdk/platform-tools
4、执行:source .zprofile 让其生效