Download maven to install the package in a Linux environment and determine where it is located.
This example apache-maven-3.2.3-bin.tar.gz installation package in the root/tools/directory
1. Enter the directory where the apache-maven-3.2.3-bin.tar.gz is located
The operation is as follows
CD Tools---ls-
CP apache-maven-3.2.3-bin.tar.gz/opt/
(Copy the jdk-7.tar.gz to the/opt/directory)
2. Enter the/opt/directory
Here's how:
cd/opt/-----ls---
Tar apache-maven-3.2.3-bin.tar.gz
(Unzip the apache-maven-3.2.3-bin.tar.gz)---
LS (with blue apache-maven-3.2.3 appearing)
3. Configuring apache-maven-3.2.3 Environment variables
The configuration of the apache-maven-3.2.3 environment variable is in the/etc/profile file.
/etc/profile "This is an environment configuration file"
Here's how:
Vim/etc/profile
m2_home=/opt/apache-maven-3.2.3
Path= $M 2_home/bin: $PATH
Export M2_home PATH (note space)
4. Must log out and re-login in order to verify that the JDK is configured correctly
Mvn-v
MAVEN installation Configuration