HADOOP-11033. shell scripts ignore JAVA_HOME on OS X. (aw)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/0340206a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/0340206a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/0340206a Branch: refs/heads/MR-2841 Commit: 0340206a29ec21d9996e7f37c905d200e5485777 Parents: a0ccf83 Author: Allen Wittenauer <a...@apache.org> Authored: Tue Sep 2 14:44:47 2014 -0700 Committer: Allen Wittenauer <a...@apache.org> Committed: Tue Sep 2 14:44:47 2014 -0700 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++ .../hadoop-common/src/main/bin/hadoop-functions.sh | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/0340206a/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index d73bf9a..2fb6f1f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -328,6 +328,8 @@ Trunk (Unreleased) HADOOP-10748. HttpServer2 should not load JspServlet. (wheat9) + HADOOP-11033. shell scripts ignore JAVA_HOME on OS X. (aw) + OPTIMIZATIONS HADOOP-7761. Improve the performance of raw comparisons. (todd) http://git-wip-us.apache.org/repos/asf/hadoop/blob/0340206a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh index dd5520c..d430188 100644 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh @@ -517,10 +517,12 @@ function hadoop_os_tricks # examples for OS X and Linux. Vendors, replace this with your special sauce. case ${HADOOP_OS_TYPE} in Darwin) - if [[ -x /usr/libexec/java_home ]]; then - export JAVA_HOME="$(/usr/libexec/java_home)" - else - export JAVA_HOME=/Library/Java/Home + if [[ -z "${JAVA_HOME}" ]]; then + if [[ -x /usr/libexec/java_home ]]; then + export JAVA_HOME="$(/usr/libexec/java_home)" + else + export JAVA_HOME=/Library/Java/Home + fi fi ;; Linux)