You may like:

How to Install Gradle on Ubuntu 20.04

Prerequisites

Apache Maven required Java language for running on any operating system. So first of all, Make sure you have Java installed on your system. also make sure you have installed JDK and JRE both. If you don’t have Java Development Kit installed on your system. Use the below command to install it.

Step 1 – Installing Apache Maven on Ubuntu

You can download Apache maven from its official website or use the following command to download Apache Maven 3.8.6 on your system. Now extract the downloaded archive using the following command.

Step 2 – Setup Environment Variables

As you have downloaded pre-compiled Apache Maven files on your system. Now set the environment variables by creating new file /etc/profile.d/maven.sh. Update the following content to file: Save your file and close. Next load the environment variables in the current shell using the following command.

Step 3 – Verify Installation

You have successfully installed and configured Apache Maven on your Ubuntu system. To find the current installed Maven version, type: Finally, clean up the disk by removing the downloaded archive file.

Conclusion

In this tutorial, You have learned about the installation of Apache Maven on the Ubuntu system.