update mvn script to run on Mac OS X

* fix the way to find JAVA_HOME on Darwin (Mac OS X)
  to be able to use JDK 1.7