In this tutorial, I will guide you all how to install Apache Maven on your macOS.
First, let download the latest version of Apache Maven at http://www-us.apache.org/dist/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz. Currently its newest version is 3.5.0.
After the download is complete, let unzip the download file:
Now, we will configure the environment variable to point to the Apache Maven bin directory. The purpose of doing this is so that we can use Apache Maven anywhere in our machine.
To do this, open the .bash_profile file located in the user directory. On my machine is /User/Khanh.
And revise the contents of this file to add a path to Apache’s Maven bin directory with the following content:
Now, you can save our changes in this file.
To make our changes can effect immediately, let reload the .bash_profile file with the following command:
Check the result: