3

(on my macbook pro) I have my download unzipped in the following folder:

/usr/local/apache-maven/apache-maven-3.3.9/

My JAVA_HOME is set:

echo $JAVA_HOME 

/Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

But i'm having issues understanding this text from the install docs:

Add the bin directory of the created directory apache-maven-3.3.9 to the PATH environment variable

What does this mean and how do I do it?

Thanks!

  • Do you know what the `$PATH` environment variable is? – Tunaki Apr 16 '16 at 20:53
  • i do not! and i cant find any helpful references online –  Apr 16 '16 at 20:59
  • Take a look at this http://stackoverflow.com/questions/22465332/setting-path-environmental-variables-in-osx-permanently – Tunaki Apr 16 '16 at 21:00
  • @Tunaki This did the trick, thanks! (Still kind of unclear what PATHs are and what the defaults are though) –  Apr 16 '16 at 21:18

2 Answers2

0

This can help,

https://askubuntu.com/questions/275704/how-to-permanently-set-environmental-variables-path-and-m2-home-in-ubuntu-for-ma

JAVA_HOME=/usr/lib/jvm/java-6-oracle/ export JAVA_HOME

M2_HOME=/usr/local/apache-maven/apache-maven-3.0.4 export M2_HOME M2=$M2_HOME/bin export M2

PATH=$PATH:$JAVA_HOME PATH=$PATH:$M2 export PATH

Community
  • 1
  • 1
OmarJ
  • 89
  • 3
0

Some important steps to install maven are:

Type the following in .bash_profile

export JAVA_HOME=/Library/Java/JavaVirtualMachines/{jdk_version}/Contents/Home
export M2_HOME=/Downloads/apache-maven-3.*.*/
export PATH=$PATH:$M2_HOME/bin
alias mvn='$M2_HOME/bin/mvn'

Replace apache-maven-3.*.*/ with your version of apache say, apache-maven-3.3.9/ Refer to this link for complete installation guide. This helped me configure it and worked on my MAC. I hope it helps

Shubham Khatri
  • 270,417
  • 55
  • 406
  • 400
  • thanks! it does help. I am unclear with the last command, what exactly does "alias mvn='$M2_HOME/bin/mvn'" do? –  Apr 17 '16 at 16:36
  • alias mvn will assign name mvn for the command '$M2_HOME/bin/mvn so that you can later use mvn instead of whole command eg mvn install – Shubham Khatri Apr 17 '16 at 17:09
  • 1
    alias enables a replacement of a word by another string. It is mainly used for abbreviating a system command, or for adding default arguments to a regularly used command – Shubham Khatri Apr 17 '16 at 17:15