Apache Maven is a build automation tool used primarily for Java projects. It helps to manage and build Java projects by automating the build process. In this tutorial, we will guide you through the process of installing Apache Maven on EndeavourOS Latest.
Before we begin with the installation process, make sure that you have the following prerequisites:
Before proceeding with the installation process, update the system to ensure that all packages are up-to-date. Use the following command:
sudo pacman -Syu
Maven requires Java to be installed on your system. To install Java, use the following command:
sudo pacman -S jdk-openjdk
Next, download the latest version of Apache Maven from the official website. Use the following command to download:
wget https://apache.osuosl.org/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz
Once the download is complete, extract the downloaded file using the following command:
tar xvf apache-maven-3.8.4-bin.tar.gz
Now, move the extracted files to the /opt directory using the following command:
sudo mv apache-maven-3.8.4 /opt/
In this step, you need to set up environment variables for Apache Maven. Create a new file called maven.sh in the /etc/profile.d/ directory.
sudo nano /etc/profile.d/maven.sh
Add the following lines to the maven.sh file:
export M2_HOME=/opt/apache-maven-3.8.4
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
Save and close the file.
Reload environment variables using the following command:
source /etc/profile.d/maven.sh
Finally, verify the installation by running the following command:
mvn -version
This command should show you the Maven version installed on your system.
Congratulations! You have successfully installed Apache Maven on EndeavourOS Latest. You can now use Maven to manage and build your Java projects.
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!