1.下载安装包
[root@izwz91h49n3mj8r232gqwez weblogic]# pwd
/weblogic
[root@izwz91h49n3mj8r232gqwez weblogic]# wget http://mirror.bit.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
--2018-09-27 07:44:03-- http://mirror.bit.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 202.204.80.77, 2001:da8:204:2001:250:56ff:fea1:22
Connecting to mirror.bit.edu.cn (mirror.bit.edu.cn)|202.204.80.77|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8491533 (8.1M) [application/octet-stream]
Saving to: ‘apache-maven-3.3.9-bin.tar.gz’
100%[====================================================================================================================================================================================================================================>] 8,491,533 710KB/s in 9.3s
2018-09-27 07:44:12 (888 KB/s) - ‘apache-maven-3.3.9-bin.tar.gz’ saved [8491533/8491533]
FINISHED --2018-09-27 07:44:12--
Total wall clock time: 9.7s
Downloaded: 1 files, 8.1M in 9.3s (888 KB/s)
2.解压下载文件
[root@izwz91h49n3mj8r232gqwez weblogic]# pwd
/weblogic
[root@izwz91h49n3mj8r232gqwez weblogic]# tar -zxvf apache-maven-3.3.9-bin.tar.gz
[root@izwz91h49n3mj8r232gqwez weblogic]# ll
total 860248
drwxr-xr-x 6 root root 4096 Sep 27 07:52 apache-maven-3.3.9
-rw-r--r-- 1 root root 8491533 Nov 18 2015 apache-maven-3.3.9-bin.tar.gz
3.配置环境变量
[root@izwz91h49n3mj8r232gqwez weblogic]# vim /etc/profile
export MAVEN_HOME=/weblogic/apache-maven-3.3.9
export PATH=$PATH:$MAVEN_HOME/bin
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3ca32b48c685af6b3a69e57709674026.png)
4.使环境变量生效
[root@izwz91h49n3mj8r232gqwez weblogic]# source /etc/profile
5.验证是否安装成功
[root@izwz91h49n3mj8r232gqwez weblogic]# mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /weblogic/apache-maven-3.3.9
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: /opt/jdk1.7.0_67/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-514.26.2.el7.x86_64", arch: "amd64", family: "unix"
[root@izwz91h49n3mj8r232gqwez weblogic]#
6.linux环境下maven安装完毕