This post will show you to install and configure maven on Windows, Linux and Mac. Before performing the installation, make sure the Java Development Kit is properly installed and configured. For Linux you can refer to my post.
![]()
Maven is a Java based tool, so the very first requirement is to have JDK installed on your machine.
System Requirement
Step 1 - Verify Java Installation on your Machine
Open console and execute the following java command.
Let's verify the output for all the operating systems −
![]()
If you do not have Java installed, install the Java Software Development Kit (SDK) from https://www.oracle.com/technetwork/java/javase/downloads/index.html. We are assuming Java 1.7.0.60 as installed version for this tutorial.
Step 2 - Set JAVA Environment
Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For example −
Append Java compiler location to System Path.
Verify Java Installation using java -version command as explained above.
Step 3 - Download Maven Archive
Download Maven 2.2.1 from https://maven.apache.org/download.cgi.
Step 4 - Extract the Maven Archive
Extract the archive, to the directory you wish to install Maven 3.3.1. The subdirectory apache-maven-3.3.1 will be created from the archive.
Step 5 - Set Maven Environment Variables
Add M2_HOME, M2, MAVEN_OPTS to environment variables.
Step 6 - Add Maven bin Directory Location to System Path
Now append M2 variable to System Path.
![]() Step 7 - Verify Maven Installation
Now open console and execute the following mvn command.
Finally, verify the output of the above commands, which should be as follows −
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |