1.这两个都要添加。环境变量各种报错。mac系统
先把mac java sdk 卸载掉
https://www.java.com/zh-CN/download/help/mac_uninstall_java.html
open .bash_profile
source ~/.bash_profile
open .zshrc
source ~/.zshrc
最后一行添加
source ~/.bash_profile
# Android SDK
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# Android SDK END
# JAVA SDK
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH:.
export CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
# JAVA SDK END
网友评论