Error: JAVA_HOME is not defined correctly, when installing Maven on Mac
<p>It is suppose to be easy, but I'm having great difficulty installing Maven on to my mac 10.11.4. </p>

<p>I have created M2_HOME and PATH for Maven, but when I type in <code>mvn --version</code>, the terminal tell me </p>

<pre><code>/Users/justin/apache-maven-3.3.9/bin/mvn: line 53: uname: command not found
/Users/justin/apache-maven-3.3.9/bin/mvn: line 143: which: command not found
/Users/justin/apache-maven-3.3.9/bin/mvn: line 171: which: command not found
Error: JAVA_HOME is not defined correctly.
  We cannot execute 
</code></pre>

<p>Why is this happening?</p>

<p><a href="https://i.stack.imgur.com/pQwk4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pQwk4.png" alt="enter image description here"></a></p>