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.
- Create a JAVA_HOME System Variable
- Create an M2_HOME System Variable
- Add %JAVA_HOME%\bin;
- %M2_HOME%\bin; to your System Path
Step 1 – Download maven distribution
- Download Binary zip archive from apache-maven-3.xxx-bin.zip. Extract it in your local system.
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”.
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.
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).
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.
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.
Step 7 – Testing Installation
- Open new command line editor –>issue “mvn -version”.
- If installation success you can see below screen.
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.