下载

Ensure you has install jdk before!

  • download
  [plaintext]
1
wget http://apache.fayea.com/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
  • unzip
  [plaintext]
1
2
3
$ tar -zxf apache-maven-3.3.9-bin.tar.gz $ ls apache-maven-3.3.9 apache-maven-3.3.9-bin.tar.gz
  • get root path
  [plaintext]
1
2
$ pwd /home/hbb/tool/maven/apache-maven-3.3.9
  • config maven
  [plaintext]
1
vi ~/.bashrc

add content

  [plaintext]
1
2
3
# set maven environment export M2_HOME=/home/hbb/tool/maven/apache-maven-3.3.9 export PATH=$M2_HOME/bin:$PATH

make it work at once

  [plaintext]
1
source ~/.bashrc
  • test
  [plaintext]
1
2
3
4
5
6
7
8
$ mvn --version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00) Maven home: /home/hbb/tool/maven/apache-maven-3.3.9 Java version: 1.8.0_112, vendor: Oracle Corporation Java home: /home/hbb/tool/jdk/jdk1.8.0_112/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.4.0-57-generic", arch: "amd64", family: "unix"