Requirements

Apache Maven required Java Development Kit (JDK) to be installed on the system. Apache Maven 3.3 and above version requires JDK 1.7 or above. So make sure your server fulfills requirements before installing Apache maven.

Setting Up JAVA_HOME environment variable

The first thing that we need to do is set up JAVA_HOME. This is a system environment variable that we need to set up in order to install Maven correctly. In order to set this up correctly, you first need to install a Java Development Kit (JDK) on your computer. The Java JDK is the software development kit that you’ll need in order to be able to write code on Windows. You can find the appropriate version of the JDK for Windows at the following URL. Usually, the best version to use is the latest version of Java. You can find out how to install JDK on your machine in the link above.

Installing Maven On Windows

To download the latest version of Apache Maven, Visit its official website download page. At the writing time of this tutorial, Apache Maven 3.3.9 is the latest version available. For this tutorial, I have downloaded apache-maven-3.8.6-bin.zip and extract its content under c:\Apache\Maven

Configure MAVEN_HOME environment variable

Now that we’ve installed Maven successfully, we should set up the MAVEN_HOME system variable. This variable holds the path to the directory where your Maven installation is located. If you don’t have an environment variable set up for MAVEN_HOME, then Maven won’t be able to run. Therefore, we need to set this variable up in order to be able to successfully use Maven in our projects. Apache Maven required MAVEN_HOME and M2_HOME environment variable to set. You also need to add Apache maven bin location under systems PATH environment variable.

Also appened ;c:\Apache\Maven\bin under Path environment variable.

Verify Installation

Finally, You have successfully installed Apache Maven on your Windows system. Now open a command prompt and run mvn –version command to verify installation and installed version.

Read: How To Install Apache Maven on Ubuntu

Conclusion

This is an Apache Maven installation guide. If you want to do any kind of serious Java development, then you’ll need a build tool like Maven. Now that you’ve been through this Apache Maven installation guide, you should be able to install Maven on your computer. If you have any questions, don’t hesitate to ask in the comments below! Now, you’re ready to start building software with Maven. You can also use Maven in your daily work as a developer. It can simplify your work, especially if you work with a lot of different projects at the same time.

How to Install Apache Maven on Windows   TecAdmin - 74How to Install Apache Maven on Windows   TecAdmin - 71How to Install Apache Maven on Windows   TecAdmin - 26