Repository: spark
Updated Branches:
  refs/heads/branch-1.3 a3493eb77 -> 4aa41327d


SPARK-4044 [CORE] Thriftserver fails to start when JAVA_HOME points to JRE 
instead of JDK

Don't use JAR_CMD unless present in archive check. Add datanucleus always if 
present, to avoid needing a check involving JAR_CMD.

Follow up to https://github.com/apache/spark/pull/4873 for branch 1.3.

Author: Sean Owen <so...@cloudera.com>

Closes #4981 from srowen/SPARK-4044.2 and squashes the following commits:

3aafc76 [Sean Owen] Don't use JAR_CMD unless present in archive check. Add 
datanucleus always if present, to avoid needing a check involving JAR_CMD


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

Branch: refs/heads/branch-1.3
Commit: 4aa41327d164ed5b2830cb18eb47b93ebd27401b
Parents: a3493eb
Author: Sean Owen <so...@cloudera.com>
Authored: Fri Mar 13 17:59:31 2015 +0000
Committer: Sean Owen <so...@cloudera.com>
Committed: Fri Mar 13 17:59:31 2015 +0000

----------------------------------------------------------------------
 bin/compute-classpath.sh | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/4aa41327/bin/compute-classpath.sh
----------------------------------------------------------------------
diff --git a/bin/compute-classpath.sh b/bin/compute-classpath.sh
index f4f6b7b..fffff28 100755
--- a/bin/compute-classpath.sh
+++ b/bin/compute-classpath.sh
@@ -93,14 +93,17 @@ if [ "$num_jars" -gt "1" ]; then
   exit 1
 fi
 
-# Verify that versions of java used to build the jars and run Spark are 
compatible
-jar_error_check=$("$JAR_CMD" -tf "$ASSEMBLY_JAR" nonexistent/class/path 2>&1)
-if [[ "$jar_error_check" =~ "invalid CEN header" ]]; then
-  echo "Loading Spark jar with '$JAR_CMD' failed. " 1>&2
-  echo "This is likely because Spark was compiled with Java 7 and run " 1>&2
-  echo "with Java 6. (see SPARK-1703). Please use Java 7 to run Spark " 1>&2
-  echo "or build Spark with Java 6." 1>&2
-  exit 1
+# Only able to make this check if 'jar' command is available
+if [ $(command -v "$JAR_CMD") ] ; then
+  # Verify that versions of java used to build the jars and run Spark are 
compatible
+  jar_error_check=$("$JAR_CMD" -tf "$ASSEMBLY_JAR" nonexistent/class/path 2>&1)
+  if [[ "$jar_error_check" =~ "invalid CEN header" ]]; then
+    echo "Loading Spark jar with '$JAR_CMD' failed. " 1>&2
+    echo "This is likely because Spark was compiled with Java 7 and run " 1>&2
+    echo "with Java 6. (see SPARK-1703). Please use Java 7 to run Spark " 1>&2
+    echo "or build Spark with Java 6." 1>&2
+    exit 1
+  fi
 fi
 
 CLASSPATH="$CLASSPATH:$ASSEMBLY_JAR"
@@ -121,11 +124,7 @@ datanucleus_jars="$(find "$datanucleus_dir" 2>/dev/null | 
grep "datanucleus-.*\\
 datanucleus_jars="$(echo "$datanucleus_jars" | tr "\n" : | sed s/:$//g)"
 
 if [ -n "$datanucleus_jars" ]; then
-  hive_files=$("$JAR_CMD" -tf "$ASSEMBLY_JAR" org/apache/hadoop/hive/ql/exec 
2>/dev/null)
-  if [ -n "$hive_files" ]; then
-    echo "Spark assembly has been built with Hive, including Datanucleus jars 
on classpath" 1>&2
-    CLASSPATH="$CLASSPATH:$datanucleus_jars"
-  fi
+  CLASSPATH="$CLASSPATH:$datanucleus_jars"
 fi
 
 # Add test classes if we're running from SBT or Maven with SPARK_TESTING set 
to 1


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to