Repository: spark
Updated Branches:
  refs/heads/branch-1.0 12f5ecc8b -> 217bd5627


SPARK-1911: Emphasize that Spark jars should be built with Java 6.

This commit requires the user to manually say "yes" when buiding Spark
without Java 6. The prompt can be bypassed with a flag (e.g. if the user
is scripting around make-distribution).

Author: Patrick Wendell <pwend...@gmail.com>

Closes #859 from pwendell/java6 and squashes the following commits:

4921133 [Patrick Wendell] Adding Pyspark Notice
fee8c9e [Patrick Wendell] SPARK-1911: Emphasize that Spark jars should be built 
with Java 6.

(cherry picked from commit 75a03277704f8618a0f1c41aecfb1ebd24a8ac1a)
Signed-off-by: Tathagata Das <tathagata.das1...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/217bd562
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/217bd562
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/217bd562

Branch: refs/heads/branch-1.0
Commit: 217bd56274f10737ca0867c7d4f5b0177f75c76e
Parents: 12f5ecc
Author: Patrick Wendell <pwend...@gmail.com>
Authored: Sat May 24 18:27:00 2014 -0700
Committer: Tathagata Das <tathagata.das1...@gmail.com>
Committed: Sat May 24 18:27:13 2014 -0700

----------------------------------------------------------------------
 make-distribution.sh | 52 ++++++++++++++++++++++++++++-------------------
 1 file changed, 31 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/217bd562/make-distribution.sh
----------------------------------------------------------------------
diff --git a/make-distribution.sh b/make-distribution.sh
index 1c89027..ae52b49 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -46,27 +46,6 @@ set -e
 FWDIR="$(cd `dirname $0`; pwd)"
 DISTDIR="$FWDIR/dist"
 
-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 "***NOTE***: JAVA_HOME is not set to a JDK 6 installation. The 
resulting"
-  echo "            distribution will not support Java 6. See SPARK-1703."
-  echo "Output from 'java -version' was:"
-  echo "$JAVA_VERSION"
-fi
-
-VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v 
"INFO" | tail -n 1)
-if [ $? != 0 ]; then
-    echo -e "You need Maven installed to build Spark."
-    echo -e "Download Maven from https://maven.apache.org/";
-    exit -1;
-fi
-
 # Initialize defaults
 SPARK_HADOOP_VERSION=1.0.4
 SPARK_YARN=false
@@ -88,6 +67,9 @@ while (( "$#" )); do
     --with-hive)
       SPARK_HIVE=true
       ;;
+    --skip-java-test)
+      SKIP_JAVA_TEST=true
+      ;;
     --with-tachyon)
       SPARK_TACHYON=true
       ;;
@@ -102,6 +84,34 @@ while (( "$#" )); do
   shift
 done
 
+if [ -z "$JAVA_HOME" ]; then
+  echo "Error: JAVA_HOME is not set, cannot proceed."
+  exit -1
+fi
+
+VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v 
"INFO" | tail -n 1)
+if [ $? != 0 ]; then
+    echo -e "You need Maven installed to build Spark."
+    echo -e "Download Maven from https://maven.apache.org/";
+    exit -1;
+fi
+
+JAVA_CMD="$JAVA_HOME"/bin/java
+JAVA_VERSION=$("$JAVA_CMD" -version 2>&1)
+if [[ ! "$JAVA_VERSION" =~ "1.6" && -z "$SKIP_JAVA_TEST" ]]; then
+  echo "***NOTE***: JAVA_HOME is not set to a JDK 6 installation. The 
resulting"
+  echo "            distribution may not work well with PySpark and will not 
run"
+  echo "            with Java 6 (See SPARK-1703 and SPARK-1911)."
+  echo "            This test can be disabled by adding --skip-java-test."
+  echo "Output from 'java -version' was:"
+  echo "$JAVA_VERSION"
+  read -p "Would you like to continue anyways? [y,n]: " -r
+  if [[ ! $REPLY =~ ^[Yy]$ ]]; then
+    echo "Okay, exiting."
+    exit 1
+  fi 
+fi
+
 if [ "$NAME" == "none" ]; then
   NAME=$SPARK_HADOOP_VERSION
 fi

Reply via email to