Zach443 Zach443 - 2 months ago 14
Java Question

How to install Maven on OSX 10.10 (Yosemite)?

I am trying to install Maven on my Mac, but I can not get the JAVA_HOME variable right. The path that the maven website gives is,


however the java folder does not exist in /usr/ for me. I installed the JRE and JDK, nothing changed. How can I fix this?


Installing Maven (for me) usually involves these steps (apart from having a working java installed):

Set the following in .bashrc

export M2_HOME=/path/to/maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH

Reload bash, and now "mvn --version" should be fine. Make sure to not have any reference to JAVA_HOME in your .bashrc (or .bash_aliases) if you havent already set it to somewhere you placed your jdk.