A Beginner's Guide to Installing and Setting up Maven on Windows

Posted on April 25 2023 by Kunal Saxena
MavenJava
...

How to set up Maven on Windows

  1. Download the latest Maven distribution from the Apache Maven website (https://maven.apache.org/download.cgi). Select the .zip file for Windows.

  2. 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".

  3. 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".

  4. In the System Properties dialog box, click on the "Environment Variables" button.

  5. Under "System Variables", click the "New" button to create a new variable.

  6. 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.

  7. Next, scroll down and find the "Path" variable, then click on the "Edit" button.

  8. 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.

  9. Click OK to close all the windows.

  10. 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

maven install

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Screenshot no #2

Search
Follow us on Social Media