sarutak commented on a change in pull request #34111:
URL: https://github.com/apache/spark/pull/34111#discussion_r716545749
##########
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:
Hmm, as you say, `/usr/libexec/java_home` is not standard path and user
might put a file on the same path.
But, even though macOS 10.5+ is used, user still might overwrite the path
with their own file.
Even if we check that the OS is macOS, it's too much to check the version.
AFAIK Hadoop and Netty uses `/usr/libexec/java_home` for macOS but they just
check whether `Darwin` or not.
Also, you can use `name -s` to get the OS name.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]