I have performed all the necessary steps like the following after referring other Stack overflow threads and online resources for installing / configuring maven. Here is what I did :
export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9
export M2=$M2_HOME/bin
My Java Home variable is also, set, as shown below:
echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_60/Contents/Home
export PATH=$M2:$PATH
Inspite of doing all of the above, when I run mvn --version
, I get Error: JAVA_HOME is not defined correctly.
We cannot execute /Library/Java/JavaVirtualMachines/jdk1.8.0_60/Contents/Home/bin/java
.
PATH Output is as follows :
echo $PATH
/usr/local/apache-maven/apache-maven-3.3.9/bin:/usr/local/apache-maven/apache-maven-3.2.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/usr/local/MacGPG2/bin