i have the following in my .bash_profile
export M2_HOME=/usr/local/Cellar/maven/3.3.3
export M2=$M2_HOME/bin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
export PATH=$M2:$PATH
export PATH=$JAVA_HOME/bin:$PATH
This is a direct copy and paste from terminal
Last login: Mon May 25 20:58:46 on ttys000
Harleys-MacBook-Pro:~ chiphansel$ open .bash_profile
Harleys-MacBook-Pro:~ chiphansel$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
Harleys-MacBook-Pro:~ chiphansel$ mvn -version
Error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher
Harleys-MacBook-Pro:~ chiphansel$ echo $PATH
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/bin:/usr/local/Cellar/maven/3.3.3/bin:/usr/bin:/usr/sbin:/bin:/sbin
Harleys-MacBook-Pro:~ chiphansel$
It finds java is set up correctly (I think) and maven is the correct directory. I am new to Mac and I am finding my lack of knowledge very frustrating.
Thanks in advance.