Install latest maven on Ubuntu
Maven Installation
Get the latest maven from https://maven.apache.org/download.cgi
Choose a binary zip or tar archive (see Link header) and download with
wget https://downloads.apache.org/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.zipUnzip and move to
/usr/local/
unzip apache-maven-3.8.3-bin.zip
sudo mv apache-maven-3.8.3 /usr/localadd to path and reopen terminal
export PATH=/usr/local/apache-maven-3.8.3/bin:$PATHor
ln -s /usr/local/apache-maven-3.8.3/bin/mvn /usr/bin/mvnmvn version check
$ mvn -version
Apache Maven 3.8.3 (...)
Maven home: /usr/local/apache-maven-3.8.3
Java version: 1.8.0_292, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-18362-microsoft", arch: "amd64", family: "unix"[1] https://maven.apache.org/install.html
[2] https://maven.apache.org/download.cgi
Troubleshooting
1 Command 'unzip' not found
for installing unzip,
do:
2 The JAVA_HOME environment variable is not defined correctly
3 check for java
Install Java as per the instructions in the next section.
Java Installation
for installing java:
use JDK not JRE. i.e., openjdk-8-jdk-headless instead of openjdk-8-jre-headless otherwise you would come across an error like: Unable to find javadoc command:The javadoc executable '/usr/lib/jvm/java-11-openjdk-amd64/bin/javadoc'
Video
Run through of commands
Last updated
Was this helpful?