How to Install Apache Maven on Manjaro

Apache Maven is a widely used build and dependency management tool used for Java-based applications. Here's a step-by-step tutorial on how to install Apache Maven on your Manjaro system.

Step 1: Update your system

Before installing Apache Maven, it's important to make sure your system is up-to-date. Run the following commands in the terminal to update your system:

sudo pacman -Syu

Step 2: Install Java

Apache Maven requires Java to be installed on your system. To install Java, run the following command:

sudo pacman -S jre-openjdk

Step 3: Download Apache Maven

Go to the Apache Maven website at http://maven.apache.org/download.cgi and download the latest version of Apache Maven. Look for the file with the extension '.tar.gz'.

Step 4: Extract the downloaded file

Once the download is complete, navigate to the Downloads folder in the terminal and extract the downloaded file using the following command:

tar xvzf apache-maven-3.x.x.tar.gz

Replace '3.x.x' with the version number you downloaded.

Step 5: Move the extracted folder

After extracting the downloaded file, move the extracted folder to your desired location. For example, you can move it to the /opt directory using the following command:

sudo mv apache-maven-3.x.x /opt/

Step 6: Set Environment Variables

To use Apache Maven, you need to set two environment variables: M2_HOME and PATH.

Set M2_HOME variable:

export M2_HOME=/opt/apache-maven-3.x.x

Replace '3.x.x' with the version number you downloaded.

Set PATH variable:

export PATH=$PATH:$M2_HOME/bin

To make these changes permanent, add these two lines to the bottom of the .bashrc file located in your home directory.

Step 7: Verify your installation

To verify your Apache Maven installation, run the following command:

mvn --version

You should see the version number of Apache Maven and its configuration details printed on the terminal if the installation was successful.

Congratulations! You have successfully installed Apache Maven on your Manjaro system.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!