Maven is a command-line tool for building Java applications; it is written in Java and is used for building JVM programs. Therefore, it is necessary that Java is installed into the system prior to installing and using Maven.
It is necessary that the commands from the Java JDK are in the
To install Maven on windows:
Visit the Apache Maven site, download the Maven zip file of the latest version, and unzip the file to the folder that you want to use Maven in.
MAVEN_HOME variables to the Windows environment variables (using system properties), and point them to your Maven folder.
PATH variable by appending the Maven bin folder
– %M2_HOME%\bin. This way, Maven’s commands can be run anywhere.
To check whether or not the above steps have been completed successfully, run the following command in the command prompt:
The command should display the Maven version, the Java version, and the operating system information.
To install Maven on Linux/Unix:
Visit the Apache Maven site, download the Maven binary tar.gz file of the latest version, and extract the archive to the folder you want to use Maven in.
Open the terminal and run the following commands to set the environment variables; for example, if apache-maven-3.3.9-bin.tar.gz file was downloaded, the commands would be:
export MAVEN_OPTS=-Xms256m -Xmx512m
M2_Homepath will have to correspond with the location of the extracted Maven files.
M2variable to the system path by running the following command:
To check whether or not the above steps have been completed successfully, run the following command in the terminal:
The command should display the Maven and Java versions installed on the system.
View all Courses