How to install Maven on Windows




Maven_logo.svg

installing Maven on Windows

Maven is a command-line tool made for building Java (and also other) programs. We can install maven using a simple ZIP file containing a pre-compiled version of Maven for our convenience. There is no Maven installer.

In order to install maven we need to fulfill some prerequisites and set environment to run it on Windows.

Prerequisites

Maven is written in Java (and mainly used to build Java codes). So, the major prerequisite is the Java SDK.

 

Step 1. setting JAVA_HOME

Make sure that Java is installed in your windows operating system. Then set the Windows environment variable called “JAVA_HOME” as shown below :

Open the default installation path if the Java JDK:

The Java folder must contain the following subsirectory:

Set the JAVA_HOME Variable

Once you have the JDK installation path:

  1. Right-click My Computer icon on your desktop and select Properties.
  2. Click the Advanced tab, then click the Environment Variables button.
  3. Under System Variables, click New.
  4. Enter the variable name as JAVA_HOME.
  5. Enter the variable value as the installation path for the Java Development Kit.
  6. Click OK.
  7. Click Apply Changes.

Set the JAVA_HOME Variable

 

Step 2. Downloading Apache Maven

Open the Maven official website and download the Maven zip file, e.g. apache-maven-3.3.9-bin.zip. Unzip the zip to the folder of you choice.

Let’s say we unzip to this folder – C:\apache-maven-3.3.9

apache-maven

 

step 3. Add M2_HOME and MAVEN_HOME

Add M2_HOME and MAVEN_HOME

step 4. M2_HOME To PATH

Add %M2_HOME%\bin to PATH variable,  so that you can run the Maven’s command line from anywhere.
M2_HOME To PATH

 

Step 5. verify Maven

run mvn –version in the command prompt.

verify maven

 

Apache Maven is installed successfully on Windows. Enjoy!!

Video Instructions


Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com