- 下载maven
http://maven.apache.org/[root@localhost install]# wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
- 配置环境变量
[root@localhost install]# tar -zxvf apache-maven-3.3.9-bin.tar.gz [root@localhost install]# vi /etc/profile最后添加export JAVA_HOME=/usr/java/jdk1.8.0_111export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/jre/lib/tools.jarexport ROCKETMQ_HOME=/usr/rocketmq/rocketmq-r4.0.0export M2_HOME=/root/install/apache-maven-3.3.9export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$ROCKETMQ_HOME/bin:$PATH
- 查看是否安装成功
[root@localhost ~]# mvn -vApache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)Maven home: /root/install/apache-maven-3.3.9Java version: 1.8.0_111, vendor: Oracle CorporationJava home: /usr/java/jdk1.8.0_111/jreDefault locale: en_US, platform encoding: UTF-8OS name: "linux", version: "3.10.0-327.el7.x86_64", arch: "amd64", family: "unix"[root@localhost ~]#