Home Hibernate How to Install Maven on windows - step by step guide

How to Install Maven on windows – step by step guide

- Advertisement -

A step by step guide to install Maven on windows, you just need to download Apache Maven zip file, extract in a directory and configure the following variable.

To Install Maven on windows

Prerequisites : Java JDK installation 1.7 or higher.

  1. Create a JAVA_HOME System Variable
  2. Create an M2_HOME System Variable
  3. Add %JAVA_HOME%\bin;
  4. %M2_HOME%\bin; to your System Path

Step 1 – Download maven distribution

download maven to local

Step 2 – open environment variables

  • Open your system properties, to do that right click on “My Computer” –> click on “Properties” –> click on “Advanced System Settings”. Below window will pop-up.
  • Click on “Environment Variables”.

install maven on windows - adding environment variables

Step 3 –  JDK and JAVA_HOME

  • Under User Variables click on “New..” –> Create a JAVA_HOME variable, follow below screen.
  • Java home path is location of java installation in the system.

maven installation set java home path

Step 4 – Add MAVEN_HOME or M2_HOME

  • Under User Variables click on “New..” –> Create a MAVEN_HOME variable, follow below screen.
  • Maven home path is location of maven installation(Extracted directory in Step 1).

maven installation set MAVEN_HOME or M2_HOME path

Step 5 – Add %JAVA_HOME%\bin to path

Skip this step if JAVA_HOME already set to path.

  • Under System Variables click on “path..” –> click on  “Edit” –> add java bin path to the path variable, follow below screen.
  • In java bin is the standard directory name where jars or native libraries of the application available and it will be in home path.

Maven installation set java bin path to system path

Step 6 – Add %MAVEN_HOME%\bin to path

  • Under System Variables click on “path..” –> click on  “Edit” –> add maven bin path to the path variable, follow below screen.
  • Now installation has completed.

Maven installation set maven bin path to system path

Step 7 – Testing Installation

  • Open new command line editor –>issue “mvn -version”.
  • If installation success you can see below screen.

maven setup test in windows

Conclusion

In this guide we have seen how to install maven on windows in step by step. Did it work for you or any issue comment below.

Satish Varma
Satish Varmahttps://javabydeveloper.com
Satish is post graduated in master of computer applications and experienced software engineer with focus on Spring, JPA, REST, TDD and web development. Also founder of javabydeveloper.com. Follow him on LinkedIn or Twitter or Facebook

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay in Touch

Categories