Maven environment setup

Maven environment setup

Because Maven is a Java-based programme, the first need is for you to have JDK installed.

Step 1: Check your machine's Java installation.

Open the terminal and run the java command shown below.

Verify all the operating systems’ output.

Install the Java Software Development Kit (SDK) from if you don't already have it.

Maven environment setup

Set the JAVA HOME environment variable to the place where Java is installed on your machine's base directory. For example −

For example −

Maven environment setup

Appending the Java compiler location on the System Path.

Verifying the Java Installation via java -version command as described above.

Step 3 – Downloading the Maven Archive

Downloading the Maven 2.2.1 via

Step 4: Open the Maven Archive and extract the files.

Install Maven 3.3.1 in the directory where you extracted the download. The archive will be used to build the apache-maven-3.3.1 subfolder..

Step 5 – Setting the variables of the Maven Environment

Adding M2, MAVEN_OPTS, M2_HOME, to the environment variables.