DEV Community

Orestis Pantazos
Orestis Pantazos

Posted on

2 1

🔨Setup Maven on Windows

The developer always wants to install Maven on Windows as first step in order to make a Maven project on the preferred IDE such as IntelliJ IDEA, Eclipse or NetBeans IDE. The following steps are described below:

Step 1:

Setup JDK and JAVA_HOME

Make sure JDK is installed properly in the operating system and JAVA_HOME variable is added as Windows environment variable.

Step 2:

Download Apache Maven

Go to official website: https://maven.apache.org/download.cgi

Download Binary zip archive from the aforementioned website and ensure that system requirements are properly configured such as JDK, free disk space and operating system.

Unzip the folder to C:\Program Files\Apache\maven

Step 3:

Setup M2_HOME and MAVEN_HOME

Add both M2_HOME and MAVEN_HOME variables in the Windows environment and point it to the maven directory.

Note: M2_HOME or MAVEN_HOME. Maven document said add M2_HOME only, but some programs still reference Maven folder with MAVEN_HOME, so it's safer to add both.

Step 4:

Add to PATH

Update PATH variable, append Maven bin folder %M2_HOME%\bin, so that you can run the Maven command everywhere.

Step 5:

Verification

To verify maven if it works properly, try and run mvn -version command in the CMD of Windows.

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay