Mac Homebrew安装Maven记录


1. brew search maven   # 搜索maven安装的版本

image-20210912235232921

2. brew install maven@3.5
3.
# 注意安装过程中出现以下输出...If you need to have maven@3.5 first in your PATH run: 
echo 'export PATH="/usr/local/opt/maven@3.5/bin:$PATH"' >> ~/.zshrc
4. 

vim ~/.bash_profile
# 加入内容
export PATH=/usr/local/opt/maven@3.5/bin:$PATH

# 使配置文件生效
source ~/.bash_profile

# 在zshrc中设置环境变量
vim ~/.zshrc
# 加入内容
export PATH=/usr/local/opt/maven@3.5/bin:$PATH
# 使配置文件生效
source ~/.zshrc
# 测试maven
	mvn -v

image-20210913000103424

posted @ 2021-09-13 00:02  withLevi  阅读(965)  评论(0编辑  收藏  举报