mac 备忘
一.环境变量
1.基本配置:
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home
export JAVA_HOME
export PATH=${PATH}:${JAVA_HOME}/bin
MAVEN_HOME=/Users/userName/tools/ide/maven
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
export PATH=${PATH}:/Users/userName/tools/ide/adtBundle/sdk/platform-tools/
2.常见问题
修改.bash_profile文件后,因填写错误,导致Terminal除了cd命令,其它命令都提示”command not found“;

是因为/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin: 被从环境变量中删除了。不能用PATH=/some/directory,这样将删除 $PATH 中其他的所有目录,必须添加PATH=/some/directory:$PATH
解决办法:将/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:再加入到环境变量中

二.查看JAVA_HOME
通过执行 /usr/libexec/java_home -V 可以查看所有的 JAVA_HOME