Zach443 Zach443 - 1 year ago 67
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download