aboutsummaryrefslogtreecommitdiff
path: root/make-distribution.sh
diff options
context:
space:
mode:
authorPatrick Wendell <pwendell@gmail.com>2014-05-04 12:22:23 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-05-04 12:22:23 -0700
commit0c98a8f6a761b941a9e0cf6fde6df8d0b8d24057 (patch)
tree23e422a365b2e98f0f8e86e3dbb51000449a8155 /make-distribution.sh
parent0088cede592540f35f9aec0f24dc1d9bd690d878 (diff)
downloadspark-0c98a8f6a761b941a9e0cf6fde6df8d0b8d24057.tar.gz
spark-0c98a8f6a761b941a9e0cf6fde6df8d0b8d24057.tar.bz2
spark-0c98a8f6a761b941a9e0cf6fde6df8d0b8d24057.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.
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-xmake-distribution.sh14
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