You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/27 07:29:21 UTC

[GitHub] [spark] copperybean commented on a change in pull request #34111: [SPARK-36856][BUILD] Get correct JAVA_HMOE for macOS

copperybean commented on a change in pull request #34111:
URL: https://github.com/apache/spark/pull/34111#discussion_r716427383



##########
File path: build/mvn
##########
@@ -21,7 +21,12 @@ SELF=$(cd $(dirname $0) && pwd)
 . "$SELF/util.sh"
 
 if [ -z "${JAVA_HOME}" -a "$(command -v javac)" ]; then
-  export JAVA_HOME="$(dirname $(dirname $(realpath $(command -v javac))))"
+  if [ x"$(uname -a | awk '{print $1}')" = xDarwin -a \
+      $(version $(sw_vers -productVersion)) -ge $(version 10.5) ]; then

Review comment:
       I think just checking the existence of `/usr/libexec/java_home` is not a good idea, this path is not a standard for every OS, some one may put another command with same path but providing different behavior. So it's better to use a command provided by some specific OS obviously.




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org