Installing Maven on Mac OS

theUnknown
1 min readMay 22, 2019
  1. Download Maven binary archive (apache-maven-3.6.1-bin.tar.gz)

2. Go to your Downloads/ in terminal and extract the contents of the archive:

➜ Downloads tar xfz apache-maven-3.6.1-bin.tar

3. Move the extracted content to any folder, eg Applications:

mv Downloads/apache-maven* /Applications/apache-maven-3.6.1

4. Next, setup maven classpath to your environment variable by updating .bash_profile file:

  • open it in terminal:
➜ ~ open ~/.bash_profile
  • edit the file by adding the following lines:
export M2_HOME=/Applications/apache-maven-3.6.1
export PATH=$PATH:$M2_HOME/bin
  • reload .bash_profile :
➜ ~ source ~/.bash_profile

5. Now you have successfully added Maven, and you can check its version like this:

mvn -v
theUnknown

Everything is unknown until it’s known. Self-learner.