For installing Maven on Ubuntu you have two ways the easy way and the manual method. The easy way is just execute following command :
sudo apt-get install maven
Or if you use Ubuntu 16+ you can use following command too :
sudo apt install maven
Just remember you need to have root privileges.
The manual way
If you want to have the latest version of Maven on your Ubuntu go to the Maven website and download the latest binary package then you can extract it in /opt/ using command :
tar xvf apache-maven-3.5.2-bin.tar.gz -C /opt/
make sure you have set your JAVA_HOME if you don’t know how you can read this post
then open up your /etc/environment add following to your path
PATH=_YOUR_OLD_PATH:/opt/apache-maven-3.5.2/bin/
quit from your editor then type
source /etc/environment
to test if maven is installed type
mvn -v
My chief interest is software engineering, mainly dealing with Linux and Java projects, but also interested in teaching what I’ve learned, have published a couple of CBTs about programming in Persian (java/Android) and here I’ll share my thoughts and experiences in English as well.
Leave a Reply