mac 配置环境变量
source .bash_profile //更新环境变量配置,使新设置的环境变量生效
vi .bash_profile //命令窗口输入 vi .bash_profile 打开环境变量配置文件,然后点i,回车可编辑,按esc,然后输入 :wq! 四个字符则退出并保存,最后输入source .bash_profile来让环境变量生效
#配置jdk环境
export JAVA_7_HOME=/Library/java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
export JAVA_8_HOME=/Library/java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
#创建默认版本
export JAVA_HOME=$JAVA_8_HOME
#创建alias命令,实现动态切换
alias jdk8='export JAVA_HOME=$JAVA_8_HOME'
alias jdk7='export JAVA_HOME=$JAVA_7_HOME'
export PATH=/Users/rbq/flutter_sdk/flutter/bin:$PATH
export ANDROID_HOME=/Users/rbq/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export NDK_HOME=/Users/rbq/Library/Android/sdk/ndk-bundle
export PATH=$PATH:$NDK_HOME
#go环境变量
export GOPATH=/Users/rbq/gowork
export GOBIN=/usr/local/go/bin
export PATH=$PATH:$GOBIN
export PATH=${PATH}:/Applications/Android\ Studio.app/Contents/gradle/gradle-4.1/bin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*