aboutsummaryrefslogtreecommitdiff
path: root/run
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2013-06-27 22:16:40 -0700
committerMatei Zaharia <matei@eecs.berkeley.edu>2013-06-27 22:16:40 -0700
commit4974b658edf2716ff3c6f2e6863cddb2a4ddf891 (patch)
tree4de6c75351ae921e1bcc09a8ba0a27871686fad4 /run
parentaea727f68d5fe5e81fc04ece97ad94c6f12c7270 (diff)
downloadspark-4974b658edf2716ff3c6f2e6863cddb2a4ddf891.tar.gz
spark-4974b658edf2716ff3c6f2e6863cddb2a4ddf891.tar.bz2
spark-4974b658edf2716ff3c6f2e6863cddb2a4ddf891.zip
Look at JAVA_HOME before PATH to determine Java executable
Diffstat (limited to 'run')
-rwxr-xr-xrun9
1 files changed, 5 insertions, 4 deletions
diff --git a/run b/run
index 7c06a55062..805466ea2c 100755
--- a/run
+++ b/run
@@ -67,14 +67,15 @@ if [ "$SPARK_LAUNCH_WITH_SCALA" == "1" ]; then
fi
fi
else
- if [ `command -v java` ]; then
- RUNNER="java"
+ if [ -n "${JAVA_HOME}" ]; then
+ RUNNER="${JAVA_HOME}/bin/java"
else
- if [ -z "$JAVA_HOME" ]; then
+ if [ `command -v java` ]; then
+ RUNNER="java"
+ else
echo "JAVA_HOME is not set" >&2
exit 1
fi
- RUNNER="${JAVA_HOME}/bin/java"
fi
if [ -z "$SCALA_LIBRARY_PATH" ]; then
if [ -z "$SCALA_HOME" ]; then