[root@MiWiFi-R3-srv ~]# mkdir /usr/local/maven
連接: https://pan.baidu.com/s/1c6QDXW 密碼: ymq2html
[root@MiWiFi-R3-srv ~]# tar -zxvf apache-maven-3.5.0-bin.tar.gz -C /usr/local/maven/
[root@MiWiFi-R3-srv ~]# vim /etc/profile
在/etc/profile的文件末尾添加如下配置:java
export M2_HOME=/usr/local/maven/apache-maven-3.3.9 export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$M2_HOME/bin:$PATH
執行source命令讓新配置當即生效:linux
[root@MiWiFi-R3-srv ~]# source /etc/profile
[root@MiWiFi-R3-srv ~]# mvn -v Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00) Maven home: /usr/local/maven/apache-maven-3.5.0 Java version: 1.8.0_144, vendor: Oracle Corporation Java home: /usr/local/java/jdk1.8.0_144/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "3.10.0-327.el7.x86_64", arch: "amd64", family: "unix"