How to install Maven on Windows System

Apache Maven is a software project management and comprehension tool. It’s not pre-installed software with any Operating System explicitly we need to download and install it. In this article, we are going to learn about maven installation on the windows operating system.

Software Dependency

  • Apache Maven 3.6.3
  • JDK 1.8
  • Windows 10

To install Maven software we need to do the following steps:

  1. Install JDK
  2. Download Apache Maven
  3. Configure JAVA_HOME and M2_HOME in the environment variable
  4. Configure maven path in the environment variable
  5. Test Maven Installation

1. Install JDK (Java Development Kit)

Make sure that your system already having JDK installed. If it’s not installed visit JDK installation on windows operating system.

For Example: jdk1.8.0_144 is installed at ‘C:\Program Files\Java\jdk1.8.0_144’

2. Download Apache Maven

In order to install the maven first you need to download maven software. You can download it from it’s official website: Download Latest Version of Apache Maven For Example:

Now extract downloaded zip file into some folder. The extracted file looks like below image:

3. Configure JAVA_HOME and M2_HOME

JAVA_HOME is used by many Java-based applications to define the place of Java Runtime Environment (JRE) installation. And M2_HOME is used by Maven, and again it tells the program where to find Maven installation. These configurations need to be added in System Environment Variables.

System Environment Variables path:

Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables

Now click on Environment Variables button > add JAVA_HOME & M2_HOME one by one like below images:

4. Configure Maven Path

The PATH variable is used to find applications (executables, and scripts) and DLLs on Windows. If Path variable already there then click on Edit to add Maven path like below image:

5. Test Maven Installation

To verify whether maven is installed or not, open the command prompt by pressing Window Key+R , type “cmd” then press Enter Key.

After opening a command prompt type maven command “mvn -version” then press Enter and see the below output:

This is how you can find out which version of maven is installed in your system now.

Related Article:

Share with friends

1 thought on “How to install Maven on Windows System”

Leave a Comment

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