diff options
author | Patrick Wendell <pwendell@gmail.com> | 2014-05-04 12:22:23 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-05-04 12:22:38 -0700 |
commit | 2f091d5ef0a0420bed1fd7d516190a671f085644 (patch) | |
tree | b526958799f8ec100b2e28e1fd7c356cdef70383 /make-distribution.sh | |
parent | 40d05a48ce31b8c28f4331cec7be93bb3810274a (diff) | |
download | spark-2f091d5ef0a0420bed1fd7d516190a671f085644.tar.gz spark-2f091d5ef0a0420bed1fd7d516190a671f085644.tar.bz2 spark-2f091d5ef0a0420bed1fd7d516190a671f085644.zip |
SPARK-1703 Warn users if Spark is run on JRE6 but compiled with JDK7.
This add some guards and good warning messages if users hit this issue. /cc @aarondav with whom I discussed parts of the design.
Author: Patrick Wendell <pwendell@gmail.com>
Closes #627 from pwendell/jdk6 and squashes the following commits:
a38a958 [Patrick Wendell] Code review feedback
94e9f84 [Patrick Wendell] SPARK-1703 Warn users if Spark is run on JRE6 but compiled with JDK7.
(cherry picked from commit 0c98a8f6a761b941a9e0cf6fde6df8d0b8d24057)
Signed-off-by: Patrick Wendell <pwendell@gmail.com>
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-x | make-distribution.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/make-distribution.sh b/make-distribution.sh index dc8aa56a2e..2ab64ff459 100755 --- a/make-distribution.sh +++ b/make-distribution.sh @@ -51,6 +51,20 @@ if [ $? != 0 ]; then exit -1; fi +if [ -z "${JAVA_HOME}" ]; then + echo "Error: JAVA_HOME is not set, cannot proceed." + exit -1 +fi + +JAVA_CMD=$JAVA_HOME/bin/java +JAVA_VERSION=$($JAVA_CMD -version 2>&1) +if ! [[ "$JAVA_VERSION" =~ "1.6" ]]; then + echo "Error: JAVA_HOME must point to a JDK 6 installation (see SPARK-1703)." + echo "Output from 'java -version' was:" + echo "$JAVA_VERSION" + exit -1 +fi + # Initialize defaults SPARK_HADOOP_VERSION=1.0.4 SPARK_YARN=false |