To install Apache Maven on Windows, download the Maven zip file, extract it to the directory you want to install, and configure the Windows environment variables.

Tools required:

  1. JDK 1.8
  2. Maven 3.3.3
  3. Windows 7
note


Maven 3.2 requires JDK 1.6 or above, whereas Maven 3.0/3.1 requires JDK 1.5 or above

1. The JDK and JAVA_HOME

Ensure that the JDK is installed and the “JAVA_HOME” variable has been added to the Windows environment variable.

2. Download Apache Maven

Visit Maven’s official website and find the download link below:

Download the Maven zip file, such as apache-maven-3.3.3-bin.zip, and unzip it to the folder where you want to install Maven.

Suppose you unzip it to the folder – D:\software\yiibai.com\apache-maven

Note: in this step, only folders and files, installation is not required.


3. Add M2_HOME and MAVEN_HOME

Add the M2_HOME and MAVEN_HOME environment variables to the Windows environment variables and point them to your Maven folder.


M2_HOME or MAVEN_HOME


Maven says to just add M2_HOME, but some projects still reference Maven’s folder MAVEN_HOME, so add it as well for security.


4. Add to the environment variable -path

Update the PATH variable and add the Maven bin folder to the end of the PATH, such as %M2_HOME%\bin, so that you can run Maven commands from any directory in the command.


5. Verify

Complete to verify it, execute MVN -version at the command prompt and output the result as shown below:

C: \ Users \ \ Administrator > MVN - version Apache Maven 3.3.3 (7994120775791599 e205a5524ec3e0dfe41d4a06; 2015-04-22t19:57:37 +08:00) Maven home: D:\software\yiibai.com\apache-maven Java version: 1.8.0_40, vendor: Oracle Corporation Java Home: D:\Program Files\Java\jdk1.8.0_40 Default locale: zh_CN, Platform Encoding: GBK OS name:"windows 7", version: "6.1", arch: "amd64", family: "dos"Copy the code

If you see a similar message, Apache Maven is successfully installed on Windows.

Classic introduction:

Source structure




Willing to understand the framework technology or source code of friends directly ask to exchange technology: 2042849237

Some distributed solutions, friends who are willing to understand can find our team to discuss

More detailed source code reference sources