首页 > mac下环境变量设置

mac下环境变量设置

mac etc/profile里配置hadoop的环境变量,source etc/profile生效,关闭zsh终端重开环境变量又失效了,hadoop提示command not found

etc/profile,.bash_profile,.zshrc这三个啥区别?

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
TOMCAT_PATH=/Users/twogoods/javatool/apache-tomcat-8.0.33
M2_HOME=/Users/twogoods/javatool/apache-maven-3.3.9
HADOOP_HOME=/Users/twogoods/javatool/hadoop-1.2.1
GOROOT=/usr/local/opt/go/libexec
GOPATH=/Users/twogoods/go
PATH=.:$PATH:$JAVA_HOME/bin:$TOMCAT_PATH/bin:$M2_HOME/bin:$GOROOT/bin:$GOPATH/bin:$HADOOP_HOME/bin
export GOPATH=/Users/twogoods/go
export JAVA_HOME
export TOMCAT_PATH=/Users/twogoods/javatool/apache-tomcat-8.0.33/bin
export M2_HOME
export HADOOP_HOME=/Users/twogoods/javatool/hadoop-1.2.1
export PATH

cd ~
source .bash_profile
试试,etc下面是全局的,最好不要修改,.bash_profile是当前用户的,一般改这个。
如果没有 .bash_profile,touch一个就行。

【热门文章】
【热门文章】