Press "Enter" to skip to content

Linux安装maven

[root@test ~]# wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gz

[root@test ~]# tar -zxvf apache-maven-3.5.3-bin.tar.gz

[root@test ~]# mv apache-maven-3.5.3 maven

配置环境变量:

/etc/profile增加如下两行:

export MAVEN_HOME=/root/maven
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH

source /etc/profile //重新刷新配置文件

查看安装是否成功:

[root@test maven]# mvn --version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: /root/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.el7_4.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-693.2.2.el7.x86_64", arch: "amd64", family: "unix"

 

Be First to Comment

发表评论

电子邮件地址不会被公开。 必填项已用*标注