Description
See https://groups.google.com/d/msg/spark-users/uuw2e9d1l74/_bCyDfq6dywJ;
It looks like the script tries to run `java` first and falls back on `$JAVA_HOME/bin/java` only if `java` cannot be found. This should probably be the other way around, trying $JAVA_HOME first. This is important for supporting users with multiple JDKs.
We should probably do the same thing for $SCALA_HOME, checking for a user-supplied SCALA_HOME before falling back on `scala`.