2

It is suppose to be easy, but I'm having great difficulty installing Maven on to my mac 10.11.4.

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

/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 

Why is this happening?

enter image description here

halfer
  • 19,471
  • 17
  • 87
  • 173
Thor
  • 9,110
  • 14
  • 56
  • 125
  • Hmm, if `uname` and `which` are not defined, that's rather strange. I would be very surprised if they do not work on a Mac. Do they work on your console at all? These are core commands that should work everywhere, even without Java or Maven installed. What does `echo $PATH` give you? – halfer Aug 14 '16 at 21:21

1 Answers1

2

You need JAVA_HOME to be defined, as covered in installation guide.

Check out this answer for additional details for MacOS.

Community
  • 1
  • 1
B.Gen.Jack.O.Neill
  • 7,909
  • 11
  • 49
  • 77
  • 2
    the installation guide simply said "Ensure JAVA_HOME environment variable is set and points to your JDK installation", but it does not give you details on how to do so, especially for complete noobs like me – Thor Aug 14 '16 at 10:30