How to install Maven on Mac OS

In this Post we will see How to install Maven on Mac OS. Maven is build tool primary for Java projects.


Maven is written in Java. Therefore, we need to have Java JDK installed on Mac OS. Java can be install from Oracle’s download website.

If you have to View How to install Java JDK on Mac OS X ( with JAVA_HOME ) the follow the Video instruction in

Maven Installation Steps:

Step 1 Download the Apache Maven bin.tar.gz file from
Extract/unzip the distribution archive file into /Applications/apache-maven-3.4.5 by the following command.

Step 2 Add the M2_HOME environment variable. To edit your ~/.bash_profile, run the following command to open it in text editor.

Step 3 Add the following exports to your ~/.bash_profile and save it.

Step 4 Use source command on ~/.bash_profile which is used to load any functions file into the current shell script or a command prompt.

Step 5
Run the following command to verify maven version

If your Mac OS system displays information on the Apache Maven version installed, this means Maven is successfully installed on you Mac.

Video Instructions – How to install Maven on Mac


Partner Sites

  • Alice

    Didn’t work for me even though I followed every step
    -bash: mvn: command not found