How to install Maven on Windows

In this tutorial we will show how to install the maven on windows.

Installation tools

  • Windows 10
  • Java 1.8
  • Maven 3

Steps for Installation

1. Download Maven

Download the latest maven zip file from Apache Maven website.  For this tutorial we are going to download apache-maven-3.3.9-bin.zip. Let’s unzip this zip file to a folder maven C:\DeveloperTools\maven3

Here is how the folder would look like. There is no more installation required.

2.  JAVA_HOME  environment variable

JAVA_HOME is required for maven running successfully. So you should check that JAVA_HOME is defined in the environment variables. If it not defined, you need to point this variable to the home of your Java installation. For this tutorial we have the java installed at C:\Program Files\Java\jdk1.8.0_111

Here is the how the environment variables look in my system. If you don’t find JAVA_HOME defined, please add using the New button as show in below picture

3. Add M2_HOME

M2_HOME variables is set to the location of the folder where you unzipped the maven. Here I have defined the M2_HOME

4. Add Maven to path

Next we will add the maven to the Path variable, C:\DeveloperTools\maven3\bin See below picture

 

5. Run Maven

So we are done with installation.  Now we will verify if our maven installtion is working correctly . We will open command line and type maven -version Let us see what our run command returns

C:\programtalk>mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\DeveloperTools\maven3\bin\..
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_111\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

Like this post? Don’t forget to share it!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.