HADOOP-11033. shell scripts ignore JAVA_HOME on OS X. (aw)

This commit is contained in:
Allen Wittenauer 2014-09-02 14:44:47 -07:00
parent a0ccf83dfd
commit 0340206a29
2 changed files with 8 additions and 4 deletions

View File

@ -328,6 +328,8 @@ Trunk (Unreleased)
HADOOP-10748. HttpServer2 should not load JspServlet. (wheat9) HADOOP-10748. HttpServer2 should not load JspServlet. (wheat9)
HADOOP-11033. shell scripts ignore JAVA_HOME on OS X. (aw)
OPTIMIZATIONS OPTIMIZATIONS
HADOOP-7761. Improve the performance of raw comparisons. (todd) HADOOP-7761. Improve the performance of raw comparisons. (todd)

View File

@ -517,10 +517,12 @@ function hadoop_os_tricks
# examples for OS X and Linux. Vendors, replace this with your special sauce. # examples for OS X and Linux. Vendors, replace this with your special sauce.
case ${HADOOP_OS_TYPE} in case ${HADOOP_OS_TYPE} in
Darwin) Darwin)
if [[ -x /usr/libexec/java_home ]]; then if [[ -z "${JAVA_HOME}" ]]; then
export JAVA_HOME="$(/usr/libexec/java_home)" if [[ -x /usr/libexec/java_home ]]; then
else export JAVA_HOME="$(/usr/libexec/java_home)"
export JAVA_HOME=/Library/Java/Home else
export JAVA_HOME=/Library/Java/Home
fi
fi fi
;; ;;
Linux) Linux)