Tuesday, June 16, 2020

How to install Maven on Mac Terminal

A maven is a command-line tool for building Java applications.
Maven Installation Steps

  1. Download the Apache Maven : Click Me Downloading Apache Maven
  2. Download : Bivenary tar.gz archi file

  1. Extract from downloaded file and move inside the Applications. Type following on terminal.
cd Downloads/
pwd
mv apache-maven-3.6.3/Applications/
cd maven-3.6.3/
ls -l
  1. If you do not have a .bash_profile file ,then create it.
touch .bash_profile
open -e ~/.bash_profile
  1. Add the M2_HOME environment variable. Edit your ~/.bash_profile . bash file opens and copy paste following code inside it and save it.
export M2_HOME=/Applications/apache-maven-3.6.3
export PATH=$PATH:$M2_HOME/bin
  1. Go to the terminal
clear
mvn -version


7. If you want to see the maven installation path. Then type: echo $MAVEN_HOME
8. Similarly, the Java path: echo $JAVA_HOME


No comments:

Post a Comment