Skip to content

Commit 39b8b14

Browse files
committed
SPARK-1737: Warn rather than fail when Java 7+ is used to create distributions
Also moves a few lines of code around in make-distribution.sh. Author: Patrick Wendell <[email protected]> Closes #669 from pwendell/make-distribution and squashes the following commits: 8bfac49 [Patrick Wendell] Small fix 46918ec [Patrick Wendell] SPARK-1737: Warn rather than fail when Java 7+ is used to create distributions.
1 parent 951a5d9 commit 39b8b14

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

make-distribution.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,11 @@
3939
# 5) ./bin/spark-shell --master spark://my-master-ip:7077
4040
#
4141

42+
set -o pipefail
4243
# Figure out where the Spark framework is installed
4344
FWDIR="$(cd `dirname $0`; pwd)"
4445
DISTDIR="$FWDIR/dist"
4546

46-
set -o pipefail
47-
VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
48-
if [ $? != 0 ]; then
49-
echo -e "You need Maven installed to build Spark."
50-
echo -e "Download Maven from https://maven.apache.org/"
51-
exit -1;
52-
fi
53-
5447
if [ -z "$JAVA_HOME" ]; then
5548
echo "Error: JAVA_HOME is not set, cannot proceed."
5649
exit -1
@@ -59,10 +52,17 @@ fi
5952
JAVA_CMD="$JAVA_HOME"/bin/java
6053
JAVA_VERSION=$("$JAVA_CMD" -version 2>&1)
6154
if ! [[ "$JAVA_VERSION" =~ "1.6" ]]; then
62-
echo "Error: JAVA_HOME must point to a JDK 6 installation (see SPARK-1703)."
55+
echo "***NOTE***: JAVA_HOME is not set to a JDK 6 installation. The resulting"
56+
echo " distribution will not support Java 6. See SPARK-1703."
6357
echo "Output from 'java -version' was:"
6458
echo "$JAVA_VERSION"
65-
exit -1
59+
fi
60+
61+
VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "INFO" | tail -n 1)
62+
if [ $? != 0 ]; then
63+
echo -e "You need Maven installed to build Spark."
64+
echo -e "Download Maven from https://maven.apache.org/"
65+
exit -1;
6666
fi
6767

6868
# Initialize defaults

0 commit comments

Comments
 (0)