How to Install Maven on Windows

Gaurav Shah
3 min readMar 23, 2024

--

Introduction

Maven is a popular open-source build tool developed by The Apache Sofware Foundation to build, publish, and deploy several projects simultaneously for better project management. The tool allows developers to build and document the lifecycle framework.

Pre-requisite

Before installing Maven, ensure you have Java installed and ready to use in your machine with the JAVA_HOME environment variable set up.
(To learn about how to install Java or how to set up the JAVA_HOME environment variable, refer to the Guide to Install Java on Windows)

Download and Install Maven

Download the Maven Zip File

To download the Maven zip file
1. Open a web browser and go to Maven Download Page.
2. Click on the appropriate link to download the binary zip archive of the latest version of Maven. In this example, the latest available version is Maven 3.9.6

Download Maven

Note: The download page usually contains the latest available version. You can access the earlier version using the archives link in the Previous Releases section.

Selecting an Older Version

3. Maven does not require any installation process. Just extract the Maven archive to a directory of your choice once the download is complete. For this tutorial, we are using C:\Program Files\Maven\apache-maven-3.9.6

Maven Folder

Set Environment Variables

To configure Maven environment variables in Windows, follow the following steps

1. Add MAVEN_HOME System Variable

1. Open the Start menu and search for environment variables.
2. Select Edit the system environment variables.

Edit Environment Variables

3. Select the Advanced tab in the System Properties window.
4. Click Environment Variables.

5. Click New under the System variables category to create a new variable.

5. Name the variable MAVEN_HOME.
6. Enter the path to your Maven Extract directory in the variable value field.
7. Click OK.

2. Add Maven to the Path Variable

1. In the Environment Variables wizard, Select the Path variable in the System variables category and click Edit.

2. Click New.
3. Enter the path as %MAVEN_HOME%\bin.
4. Click OK to save the changes and exit the variable editing window.

Confirm the changes by clicking OK in the Environment Variables and System properties windows.

Verify Maven Installation

Verify that Maven is installed by entering the mvn -version command in the command prompt. If installed correctly, the command outputs the maven version.

Installing Java on Windows: A Beginner’s Guide
How to install Java on Windows

For more Java-related blogs, check out my profile:
https://medium.com/@gauravshah97

Reach me out at:
https://www.linkedin.com/in/gauravshah97/

--

--