A Beginner's Guide to Installing and Setting up Maven on Windows
![...](/assets/images/post/big/5bg.png)
How to set up Maven on Windows
-
Download the latest Maven distribution from the Apache Maven website (https://maven.apache.org/download.cgi). Select the .zip file for Windows.
-
Extract the downloaded .zip file to a location on your computer where you would like to install Maven. For example, you can extract it to "C:\Program Files\Apache Maven".
-
Once you have extracted the files, you need to set up the environment variables for Maven. To do this, open the Start menu and search for "Environment Variables".
-
In the System Properties dialog box, click on the "Environment Variables" button.
-
Under "System Variables", click the "New" button to create a new variable.
-
Set the "Variable name" to "MAVEN_HOME" and the "Variable value" to the path where you extracted Maven. For example, "C:\Program Files\Apache Maven". Refer screenshot no 1 at the end of article.
-
Next, scroll down and find the "Path" variable, then click on the "Edit" button.
-
In the Edit Environment Variable dialog, click the "New" button and add the following path: "%MAVEN_HOME%\bin". This will ensure that the Maven executable is in your system's PATH. Refer screenshot no 2 at the end of article.
-
Click OK to close all the windows.
-
Open a new command prompt window and type "mvn -version" to verify that Maven is installed correctly.
Congratulations, you have successfully installed and set up Maven on your Windows machine!
Screenshot no #1