(1) The JDK environment is required for Maven installation. First, check that the JDK environment has been installed. You can run the Java-version command on the terminal to check the environment. Mine is:
Java version "1.7.0 _ 07"
Java (TM) se Runtime Environment (build 1.7.0 _ 07-b10)
Java hotspot (TM) Client VM (build 23.3-b01, mixed mode, sharing)
(2) download the latest version of maven, namely, apache-maven-3.0.4-bin.tar.gz. : Http://maven.apache.org/download.html.
(3) decompress to the/usr/local directory, the command: tar-zxvf apache-maven-3.0.4-bin.tar.gz
/Usr/local. The decompressed directory is: apache-maven-3.0.4.
(4) establish a link for easy upgrade: ln-s apache-maven-3.0.4 APACHE-Maven.
(5) In ~ /. Add the following two rows to bashrc:
Export m3_home =/usr/local/Apache-Maven Export path =$ {m3_home}/bin: $ {path}
(6) execute the following command to make the environment parameters take effect:
.~ /. Bashrc
(7) Check the MVN version and check whether the configuration is correct.
Command: MVN-version
If the installation configuration is correct, the maven version and installation directory, JDK information, and operating system information are displayed.