Install Apache Maven on macOS

In this tutorial, I will guide you all how to install Apache Maven on your macOS.

First, please download the latest version of Apache Maven at: https://maven.apache.org/download.cgi. On macOS or Linux, we will usually download the file bin.tar.gz and on Windows it is bin.zip.

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.

Install Apache Maven on macOS

And edit the contents of the PATH variable pointing to the path to the Apache 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:

Install Apache Maven on macOS

To check the results, you can enter the following command:

Result:

Add Comment