How to install Maven on Windows

Installing Maven on Windows requires few steps, just download it in some folder, set it in the path and define the environment variable _M2HOME

Read this post with the steps to install Maven

Summary of steps

Download the latest version of Maven and unzip it

Download from []1https://maven.apache.org/download.cgi

For this example, I have downloaded and decompressed maven in C:\developer\apache-maven

Define the environment variables

Add Maven \bin to your Path and create an M2_HOME environment variable.

Open the System Properties by pressing Windows + R and type sysdm.cpl

Then in the Advanced tab, enter Environment Variables and add to Path C:\developer\apache-maven\bin (including the \bin folder)

maven-path

In the same window add a new variable M2_HOME with the path where you have maven, in this example C:\developer\apache-maven

M2_HOME-environment-variables

Make sure you have JAVA_HOME well defined in your environment variables pointing to Java.

JAVA_HOME-environment-variables

Check if everything went well with Maven

Again press Windows + R and then type cmd to enter the windows console.

In the console check with mvn -v. You should see a similar message.

    Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T08:57:3
    7-03:00)
    Maven home: C:\developer\apache-maven\bin\..
    Java version: 1.8.0_60, vendor: Oracle Corporation
    Java home: C:\Program Files\Java\jre1.8.0_60
    Default locale: en_US, platform encoding: Cp1252
    OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

Conclusion:

To install maven on windows you need to download maven, add the enviroment variable M2_MAVEN and finally add the maven folder with the subfolder /bin to the windows path.

Let me know if this guide helped you and if you want to add something else.

Maven