环境: 当前已经有 .bash_profile文件了
打开.bash_profile: open -e .bash_proile
open -e .bash_profile
查看node安装路径:
which node
修改.bash_profile
最后配置生效:source .bash_profile
source .bash_profile
检查:
node变量成功:
node -v
java变量成功:
java -version
分享.bash_profile文件:
export MAVEN_HOME=/Library/apache-maven-3.6.0
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
export TOMCAT_HOME=/Library/Tomcat/bin
export NODE_HOME=/usr/local/bin
PATH=$PATH:$MAVEN_HOME:$JAVE_HOME/bin:$TOMCAT_HOME:$NODE_HOME:.
CLASSPATH=$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:.
export PATH
export CLASSPATH