mac brew 安装maven

1.查看

brew info maven #查看brew中maven的基本信息

2.下载

brew install maven will install Maven 3.3.1 (3/24/15) #版本可以不加,默认下载最新的

3.设置maven环境变量

mac中环境变量配置文件~/.bash_profile ;注:不同的操作系统或者使用用户,环境变量不一样,比如linux;也可以直接执行export命令来设置。

vi ~/.bash_profile
    #maven
    export M2_HOME=/usr/local/Cellar/maven/3.3.9/libexec
    export PATH=$PATH:$M2_HOME/bin
  
#修改后的文件生效
source ~/.bash_profile

4.安装结果测试

猜你喜欢

转载自blog.csdn.net/shenchengxinsunwei/article/details/84423255