Would you like to learn how to do an Apache Maven installation on Ubuntu Linux? In this tutorial, we are going to show you how to download and install Apache Maven on a computer running Ubuntu Linux.
• Ubuntu 18.04
• Ubuntu 19.04
• Ubuntu 19.10
• Apache Maven 3.6.2
• Openjdk version 11.0.4
Hardware List:
The following section presents the list of equipment used to create this Apache Maven tutorial.
Every piece of hardware listed above can be found at Amazon website.
Apache Maven – Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Apache Maven.
Tutorial Apache Maven – Installation on Ubuntu Linux
Install the Java JDK package.
Use the following command to find the Java JDK installation directory.
This command output should show you the Java installation directory.
In our example, our Java JDK is installed under the folder: /usr/lib/jvm/java-11-openjdk-amd64
Now, you need to create an environment variable named JAVA_HOME.
Let’s create a file to automate the required environment variables configuration
Here is the java.sh file content.
Reboot the computer.
Use the following command to verify if the JAVA_HOME variable was created.
Here is the command output:
Use the following command to test the Java installation.
Here is the command output:
Download the Apache Maven package from the official website.
Install the Maven software on your Linux server.
Now, you need to create the following Apache environment variables: M2_HOME and MAVEN_HOME
Let’s create a file to automate the required environment variables configuration
Here is the maven.sh file content.
Reboot the computer.
Use the following command to verify if all the required environment variables were created.
Here is the command output:
Test your Apache Maven installation
This command will verify the Apache Maven version installed.
The Apache Maven installation was successfully completed.