解决:bash: mvn: command not found。linux 安装 maven

1、安装 wget 命令:

 yum -y install wget

2、下载maven安装包

 wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz

3.解压并配置maven:

vim /etc/profile

在配置文件配置中加上:

export MAVEN_HOME=/opt/apache-maven-3.5.4  (这个目录换成你的 maven 解压后的文件所在目录)
export PATH=$MAVEN_HOME/bin:$PATH

保存退出后刷新配置文件

source /etc/profile

4、查看maven版本

mvn -version
posted @ 2022-05-30 09:00  Retired-lad  阅读(844)  评论(0)    收藏  举报