1,下载地址:http://maven.apache.org/download.cgi
2,

3,点击下载解压后,将文件夹复制到/usr/local下面
4,打开终端,输入vim ~/.bash_profile 按i进入编辑模式
5,将下面两句拷贝到文件内
export MAVEN_HOME=/usr/local/apache-maven-3.6.3
export PATH=
【我使用这个无效:export PATH=
添加完之后,按esc,执行:wq保存退出
6.执行 source ~/.bash_profile 为配置环境变量生效
7.测试 mvn -v 查看是否出现maven版本

网友评论