dongjoon-hyun commented on a change in pull request #25472: [SPARK-28756][R] Fix checkJavaVersion to accept JDK8+ URL: https://github.com/apache/spark/pull/25472#discussion_r314667733
########## File path: R/pkg/R/client.R ########## @@ -91,11 +91,16 @@ checkJavaVersion <- function() { }, javaVersionOut) javaVersionStr <- strsplit(javaVersionFilter[[1]], "[\"]")[[1L]][2] - # javaVersionStr is of the form 1.8.0_92. - # Extract 8 from it to compare to sparkJavaVersion - javaVersionNum <- as.integer(strsplit(javaVersionStr, "[.]")[[1L]][2]) - if (javaVersionNum != sparkJavaVersion) { - stop(paste("Java version", sparkJavaVersion, "is required for this package; found version:", + # javaVersionStr is of the form 1.8.0_92/9.0.x/11.0.x. + # We are using 8, 9, 10, 11 for sparkJavaVersion. + versions = strsplit(javaVersionStr, "[.]")[[1L]] + if ("1" == versions[1]) { + javaVersionNum <- as.integer(versions[2]) + } else { + javaVersionNum <- as.integer(versions[1]) + } + if (javaVersionNum < sparkJavaVersion) { + stop(paste("Java version", sparkJavaVersion, ", or greater, is required for this package; found version:", Review comment: Oops. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org