How Do You Install Maven on Linux?

Problem scenario
How do you install Apache Maven on any distribution of Linux?

This is based on Apache Maven 3.5.2.*

curl > /tmp/apache-maven-3.5.2-bin.tar.gz
sudo tar -xzvf apache-maven-3.5.2-bin.tar.gz
sudo mv apache-maven-3.5.2 /opt/maven
export M2_HOME=/opt/maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
source ~/.bashrc
mvn -v 

*You can change the directions if you want. You can get the latest installation media from here:

Leave a comment

Your email address will not be published. Required fields are marked *