Install maven in ubuntu

Here you will learn to Install Maven in UBUNTU.

Check if Maven Installed

Before installing maven, first check if it is already installed or not.  To check this execute below command.

mvn -v

or

mvn -version

If output is something like below, then it means that Maven is already installed.

[email protected]:~$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.5.0-40-generic", arch: "amd64", family: "unix"

If not then you need to install maven.

Install Maven

If maven is not installed then you can install the same by executing below command.

sudo apt-get install maven

Maven Installation Directory

Default maven installation directory is “/usr/share/maven”. Still if you want to confirm the location execute the version command it will also display the folder location of Maven.

[email protected]:~$ mvn -v
Apache Maven 3.0.4

Maven home: /usr/share/maven

Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.5.0-40-generic", arch: "amd64", family: "unix"
By | 2017-07-21T21:58:27+00:00 September 12th, 2013|Maven|0 Comments

About the Author:

Leave A Comment