gengliangwang commented on a change in pull request #34111:
URL: https://github.com/apache/spark/pull/34111#discussion_r717234192
##########
File path: build/mvn
##########
@@ -21,7 +21,14 @@ 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 [ "$(uname -s)" = "Darwin" ]; then
+ # For some version of macOS, "/usr/bin/javac" is a real file instead of a
symbolic link,
Review comment:
```suggestion
# For some versions of macOS, "/usr/bin/javac" is a real file instead of
a symbolic link,
```
##########
File path: build/mvn
##########
@@ -21,7 +21,14 @@ 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 [ "$(uname -s)" = "Darwin" ]; then
+ # For some version of macOS, "/usr/bin/javac" is a real file instead of a
symbolic link,
+ # so the java home may be set to path "/usr" improperly.
+ # And following command is the appropriate way of getting java home on
macOS.
Review comment:
```suggestion
# The following command is an appropriate way of setting JAVA_HOME on
macOS.
```
##########
File path: build/mvn
##########
@@ -21,7 +21,14 @@ 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 [ "$(uname -s)" = "Darwin" ]; then
+ # For some version of macOS, "/usr/bin/javac" is a real file instead of a
symbolic link,
+ # so the java home may be set to path "/usr" improperly.
Review comment:
```suggestion
# so the JAVA_HOME may be set to path "/usr" improperly.
```
--
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]