Skip to main content

How to install Apache Maven on Windows 10?

Apache Maven is a Java tool that helps in building and managing the Java project. It is based on the concept of Project Object Modle(POM). It helps the Java developers to manage the project's JAR files in a central repository and those JAR files can be shared across the project.

Maven project has the following objectives

  • makes the build process easy
  • provides a uniform build system
  •  and many more
In this post, we will learn how to install the Apache Maven on Windows (10).

STEP 1: Download and install Java

Download Java from and install it.

STEP 2: Download Apache Maven

Download Apache Maven from and extract it on your local machine like I have unzipped it to E:\apache-maven-3.6.2

STEP 3: Set the JAVA_HOME environmental variable

  • Right Click This PC ->  Properties -> Advanced system settings -> Environmental Variables

Open Environmental Variables
  • Click on New and add the following
Variable Name: JAVA_HOME
Variable Value: Path to your installed Java directory

STEP 4: Add Java bin directory to the path variable

Select path ->Click on  Edit -> New 

STEP 5: Set M2_HOME (or MAVEN_HOME) variable to environmental variables

  • Click on New and add the following
Variable Name : M2_HOME 
Variable Value : E:\apache-maven-3.6.2 ( set this value to your maven directory)

Note that M2_HOME or MAVEN_HOME can be set as a variable name.

STEP 6: Add maven bin directory to path variable

Select path ->Click on  Edit -> New 

STEP 7: Open Command Prompt as administrator

Type mvn -version

It displays the Apache Maven version on the console and will confirm the successful installation of Maven on your local PC. If you get the following message, repeat the above steps carefully 

mvn is not recognized as an internal or external command,
operable program or batch file.


In this post, we have learned how to install Apache Maven on Windows 10.



Popular posts from this blog

Eclipse - Server Tomcat v8.5 Server at localhost failed to start.

When I try to launch the tomcat from Eclipse, I encountered the following error Server Tomcat v8.5 Server at localhost failed to start. Solution Step 1  Delete the .snap file located at the following location     eclipse workspace Path\ .metadata\.plugins\org.eclipse.core.resources Step 2 Delete the  tmp0  folder from the following path      eclipse workspace Path \.metadata\.plugins\org.eclipse.wst.server.core Step 3  Delete the server from servers list Step 4  Remove already added Tomcat Server      i)  Click on Define a new Server     ii)  Select Server Runtime Environments     iii) Select the Tomcat Server and remove it as follows Remove Selected Server Step 5 Make sure that correct version of Server is configured in Project Properties Step 6 Restart the Eclipse IDE.

hibernate-release-5.4.4.Final - Required Jars

Introduction Hibernate (Object Relational Mapping framework) is an implementation of Java Persistence API (JPA) specification.   Required Jars for Hibernate 5.4.4 Following Jars resided inside the required folder are the mandatory jars required for Hibernate 5.4.4 antlr-2.7.7.jar byte-buddy-1.9.11.jar classmate-1.3.4.jar dom4j-2.1.1.jar FastInfoset-1.2.15.jar hibernate-commons-annotations-5.1.0.Final.jar hibernate-core-5.4.4.Final.jar istack-commons-runtime-3.0.7.jar jandex-2.0.5.Final.jar javassist-3.24.0-GA.jar javax.activation-api-1.2.0.jar javax.persistence-api-2.2.jar jaxb-api-2.3.1.jar jaxb-runtime-2.3.1.jar jboss-logging-3.3.2.Final.jar jboss-transaction-api_1.2_spec-1.1.1.Final.jar stax-ex-1.8.jar txw2-2.3.1.jar Hibernate 5.4.4 release is compatible with  Java 8 or 11  JPA 2.2 References

Intellij : How to add @author comment to every new class

 Introduction In this tutorial, we will learn how to add @author comments to every new class that we create. We can achieve it using either of the following two solutions Solution 1:  Automatically add @author comments to every new class using Files and Code Templates Open File -> Settings -> Editor -> File and Code Templates -> Includes Click on Includes . Under File Header , enter the following comments text /**  * @author ${USER}  * @Date ${DATE}   */ Intellij - add @author comments Solution 2: Autocompletion of @author Open File  ->  Settings  ->  Editor  -> Live Templates Select Java and then click on + button In Abbreviation, enter @a In template text , enter the following comments           /**             * @author ${USER}             * @Date ${DATE}            */ In option , Expands with select SPACE Intellij - Autocompletion @author You can simply add the @author comments by typing @a and then click SPACE