Outline
Apache Maven want to install on a Windows system, you need to download Maven zip file and unzip it to the directory where you want to install and configure Windows environment variables.
Note: Please try to use JDK 1.8 and above
JDK and JAVA_HOME
Make sure that the installed JDK, and set JAVA_HOME
the environment variable to the Windows environment variables.
Download Apache Maven
Download: maven.apache.org/download.cg...
Maven download zip file, for example: apache-maven-3.6.0-bin.zip, extract it to a file you want to install Maven folder. Suppose you extract the files to a folder - D: \ apache-maven-3.6.0
Note: At this stage, only the folders and files, installation is not required.
Add MAVEN_HOME
If you are a maven 3.5.0 version of the add MAVEN_HOME
and M2_HOME
environment variable to the Windows environment variables, and point it to your Maven folder.
Add to the environment variables - PATH
References M2_HOME
to, Maven 2 Maven is a complete rewrite, not backward compatible. _HOME have two different variables means that you can run simultaneously on the same machine.
- path reference
Why two HOME, take a look at how to say stackoverflow
verification
Open the cmd
window, use the command:mvn -version
Output:
C:\Users\Lusifer>mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T15:58:13+08:00)
Maven home: D:\apache-maven-3.5.2\bin\..
Java version: 1.8.0_152, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_152\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
复制代码
Reproduced in: https: //juejin.im/post/5cf62234f265da1b7401e979