Blog.csdn.net/qq_32706349…

1. Download the installation package

Go to the Maven official website to download -apache-maven-3.6.0-bin.tar.gz and upload it to the Linux server

2. Run the tar -zxvf apache-maven-3.6.0-bin.tar.gz command to decompress the Maven installation package

3. Configure environment variables

Vi /etc/profile Add the following information to the end of the file:

MAVEN_HOME=/usr/local/ apache maven -- 3.6.0export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
Copy the code

Run the source /etc/profile command for the configuration to take effect

4. Check whether the MVN -version command is successfully installed. If the following output is displayed, the installation is successful

[root@zcfLinux home]# mvn -version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018- 10-25T02:41:47+08:00)
Maven home: /home/apache-maven- 3.6.0
Java version: 1.8.0_161, vendor: Oracle Corporation, runtime: /usr/local/jdk1.8.0_161/jre
Default locale: zh_CN, platform encoding: UTF- 8 -
OS name: "linux", version: "2.6.32-642. El6. I686", arch: "i386", family: "unix"
Copy the code