Apache Maven is a software project management and comprehension tool. It’s not pre-installed software with any Operating System, explicitly we need to download and install it. In this article, we are going to download Maven for Windows and install Maven on Windows 10 (64-bit) operating system.
Table of Contents
Software Dependency
- Apache Maven 3.6.3
- JDK 1.8
- Windows 10
How to install Maven in Windows 10 64-bit?
Steps to install Maven in Windows 10:
- Install JDK
- Download Apache Maven
- Configure JAVA_HOME and M2_HOME in the environment variable
- Set the maven path in the environment variable
- Check Maven Installation
Install JDK (Java Development Kit)
In order to install Maven software, it required Java. So make sure that your system already has JDK installed. If it’s not installed, then you have to install JDK first. Visit another article for this: JDK installation on Windows 10 operating system.
For Example: jdk1.8.0_144 is installed at ‘C:\Program Files\Java\jdk1.8.0_144’
Download Maven for Windows
To install apache maven on Windows, you need to download Maven for Windows. You can download it from its official website: Download Apache Maven. For example, here we have downloaded the apache-maven-3.6.3-bin.zip as shown in the below image:
Now extract the downloaded zip files into some folder. The extracted file looks like the below image:
Set maven path in an environment variable in Windows 10
We have to configure two environment variables JAVA_HOME and M2_HOME in Windows. JAVA_HOME is used by many Java-based applications to define the place of Java Runtime Environment (JRE) installation. And M2_HOME is used by Maven, and again it tells the program where to find Maven installation. These configurations need to be added to System Environment Variables.
System Environment Variables path:
Right click on MyComputer -> properties -> Advanced System Settings -> Environment variables
Now click on the Environment Variables button > add JAVA_HOME & M2_HOME one by one like the below images:
Set maven path in Windows 10
The Path variable is used to find applications (executables, and scripts) and DLLs on Windows. If the Path variable is already there then click on Edit to add a Maven path like the below image:
How to check whether Maven is installed or not?
To verify whether Maven is installed or not, open the command prompt by pressing Window Key+R, type “cmd” and then press Enter Key.
After opening a command prompt type the maven command “mvn -version” then press Enter and see the below output:
This is how you can find out which version of Maven is installed in your system now.
Conclusion
In this article, you have seen how you download apache maven and install it on the Windows 10 operating system.
FAQ
mvn is not recognized as an internal or external command
C:\Windows\System32>mvn -version'mvn' is not recognized as an internal or external command, operable program or batch file.
This means that the installation of maven is not done properly, make sure %M2_HOME%\bin is prepended to the PATH variable the right way.
JAVA_HOME environment variable is not defined correctly
C:\Windows\System32>mvn -versionThe JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE
This simply means that JDK is not installed and the JAVA_HOME variable is not properly configured.
Related Article:
- JDK 8 Installation on Windows 10 Operating System
- How to Download and Install JDK 11 on Windows 10?
- JDK 17 Installation on Windows 10 [step-by-step]
- Install MySQL Server 8.0.27 [zip Archive] on Windows 10
- Install MySQL Workbench 8.0.27 on Windows 10[step-by-step]
Thank you!!1