Skip to content

Install Maven

DBgit edited this page Jul 10, 2019 · 8 revisions

How to Install Apache Maven

Linux

Installing Maven on Debian.

First, update the package index and install Maven by running the following command:

sudo apt update
sudo apt install maven

Verify the installation by typing:

mvn -version

The output should look something like this:

Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.0-8-amd64", arch: "amd64", family: "unix"

Install OpenJDK

Maven 3.3+ require JDK 1.7 or above to be installed on your system.

Start by updating the package index and install the OpenJDK package by typing:

sudo apt update
sudo apt install default-jdk

Verify the Java installation by checking its version:

java -version

The output should look something like this:

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

MacOS

Windows