Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 575B4200C3E for ; Tue, 21 Mar 2017 22:25:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5609B160B81; Tue, 21 Mar 2017 21:25:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9D441160B6E for ; Tue, 21 Mar 2017 22:25:10 +0100 (CET) Received: (qmail 72425 invoked by uid 500); 21 Mar 2017 21:25:09 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 72416 invoked by uid 99); 21 Mar 2017 21:25:09 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Mar 2017 21:25:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B1D5ADFE1D; Tue, 21 Mar 2017 21:25:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shivaram@apache.org To: commits@spark.apache.org Message-Id: <44e95b7abda74d44920d02913988b60a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spark git commit: [SPARK-19237][SPARKR][CORE] On Windows spark-submit should handle when java is not installed Date: Tue, 21 Mar 2017 21:25:09 +0000 (UTC) archived-at: Tue, 21 Mar 2017 21:25:11 -0000 Repository: spark Updated Branches: refs/heads/branch-2.1 a88c88aac -> 5c18b6c31 [SPARK-19237][SPARKR][CORE] On Windows spark-submit should handle when java is not installed ## What changes were proposed in this pull request? When SparkR is installed as a R package there might not be any java runtime. If it is not there SparkR's `sparkR.session()` will block waiting for the connection timeout, hanging the R IDE/shell, without any notification or message. ## How was this patch tested? manually - [x] need to test on Windows Author: Felix Cheung Closes #16596 from felixcheung/rcheckjava. (cherry picked from commit a8877bdbba6df105740f909bc87a13cdd4440757) Signed-off-by: Shivaram Venkataraman Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/5c18b6c3 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/5c18b6c3 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/5c18b6c3 Branch: refs/heads/branch-2.1 Commit: 5c18b6c316509430823f4edfabe834d8143481e3 Parents: a88c88a Author: Felix Cheung Authored: Tue Mar 21 14:24:41 2017 -0700 Committer: Shivaram Venkataraman Committed: Tue Mar 21 14:25:07 2017 -0700 ---------------------------------------------------------------------- R/pkg/inst/tests/testthat/test_Windows.R | 1 + bin/spark-class2.cmd | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/5c18b6c3/R/pkg/inst/tests/testthat/test_Windows.R ---------------------------------------------------------------------- diff --git a/R/pkg/inst/tests/testthat/test_Windows.R b/R/pkg/inst/tests/testthat/test_Windows.R index e8d9834..1d777dd 100644 --- a/R/pkg/inst/tests/testthat/test_Windows.R +++ b/R/pkg/inst/tests/testthat/test_Windows.R @@ -20,6 +20,7 @@ test_that("sparkJars tag in SparkContext", { if (.Platform$OS.type != "windows") { skip("This test is only for Windows, skipped") } + testOutput <- launchScript("ECHO", "a/b/c", wait = TRUE) abcPath <- testOutput[1] expect_equal(abcPath, "a\\b\\c") http://git-wip-us.apache.org/repos/asf/spark/blob/5c18b6c3/bin/spark-class2.cmd ---------------------------------------------------------------------- diff --git a/bin/spark-class2.cmd b/bin/spark-class2.cmd index 869c0b2..9faa7d6 100644 --- a/bin/spark-class2.cmd +++ b/bin/spark-class2.cmd @@ -50,7 +50,16 @@ if not "x%SPARK_PREPEND_CLASSES%"=="x" ( rem Figure out where java is. set RUNNER=java -if not "x%JAVA_HOME%"=="x" set RUNNER=%JAVA_HOME%\bin\java +if not "x%JAVA_HOME%"=="x" ( + set RUNNER="%JAVA_HOME%\bin\java" +) else ( + where /q "%RUNNER%" + if ERRORLEVEL 1 ( + echo Java not found and JAVA_HOME environment variable is not set. + echo Install Java and set JAVA_HOME to point to the Java installation directory. + exit /b 1 + ) +) rem The launcher library prints the command to be executed in a single line suitable for being rem executed by the batch interpreter. So read all the output of the launcher into a variable. --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org