第一步:设置maven环境变量
vim ~/.bash_profile
可以设置成自己的maven仓库
export MAVEN_HOME=/Users/keying/Downloads/apache-maven-3.6.3 export PATH=${MAVEN_HOME}/bin:$PATH
第二步:执行source 但当前命令行只能让配置临时生效,关闭终端则需要再次source source ~/.bash_profile
第三步:永久生效
vim ~/.zshrc
在打开的文件开头添加
if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi
最后再执行:
source ~/.zshrc