Seven easy steps to install Maven in Windows 7
Before we configure Apache Maven to work in Windows environment, we need to install required Java(JDK) first.
If you are having Windows 64 bit then go ahead and download Java (JDK) 64 bit version,
Step-1 Download JAVA(JDK)
Download Windows x64 195.51 MB jdk-8u121-windows-x64.exe
Step-2 After you install Java successfully, Download Apache Maven zip file from this url
Note: JDK 1.6 or above requires to install Maven 3.X, while Maven 3.X requires JDK 1.5 or above
Step-3 Lets add “JAVA_HOME” in Windows environment System variable as shown in Image-1
Step-4 we have already downloaded the Apache Maven, lets unzip it and keep it here in this location. we can extract it anywhere but need to know the path which we will add it in path as shown in Image-2
Note: We need to extract the folders in this location only. No installation required.
Step-5 Next Add M2_HOME and MAVEN_HOME as System variables
Need to Add both M2_HOME and MAVEN_HOME variables in the Windows environment, also locate it to maven extracted folder as shown in Image-3
Step-6 Add to PATH Variable
Add maven bin folder location(D:\Program Files\Apache\maven\bin) in PATH variable so that you can run maven command from any location.
as shown in Image-4
Step-7 we are almost done setting up Apache Maven
Lets check it, open command prompt as run as administrator to avoid issues and type maven -version
It should result out something like this as shown in Image-5
if you are getting “‘maven’ is not recognized as an internal or external command, operable program or batch file”
then try mvn -version. Hope that will show the result.
You can follow the above mentioned steps in Windows 8 or Windows 10 to install Apache Maven.
You may also like :solve phpinfo() shows version 5.5.9 but in cli php -v shows version 7.1