diff options
author | Matthew Farrellee <matt@redhat.com> | 2014-06-24 19:31:20 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-06-24 19:32:33 -0700 |
commit | 54055fb2b73a545e7cca6c645356ef287aa5a7c4 (patch) | |
tree | 3124bf6ac8b1e7d7398401ef5c35f0199fad0b9e | |
parent | 133495d82672c3f34d40a6298cc80c31f91faf5c (diff) | |
download | spark-54055fb2b73a545e7cca6c645356ef287aa5a7c4.tar.gz spark-54055fb2b73a545e7cca6c645356ef287aa5a7c4.tar.bz2 spark-54055fb2b73a545e7cca6c645356ef287aa5a7c4.zip |
Autodetect JAVA_HOME on RPM-based systems
Author: Matthew Farrellee <matt@redhat.com>
Closes #1185 from mattf/master-1 and squashes the following commits:
42150fc [Matthew Farrellee] Autodetect JAVA_HOME on RPM-based systems
-rwxr-xr-x | make-distribution.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/make-distribution.sh b/make-distribution.sh index 6f708e0ebf..86868438e7 100755 --- a/make-distribution.sh +++ b/make-distribution.sh @@ -85,6 +85,17 @@ while (( "$#" )); do done if [ -z "$JAVA_HOME" ]; then + # Fall back on JAVA_HOME from rpm, if found + if which rpm &>/dev/null; then + RPM_JAVA_HOME=$(rpm -E %java_home 2>/dev/null) + if [ "$RPM_JAVA_HOME" != "%java_home" ]; then + JAVA_HOME=$RPM_JAVA_HOME + echo "No JAVA_HOME set, proceeding with '$JAVA_HOME' learned from rpm" + fi + fi +fi + +if [ -z "$JAVA_HOME" ]; then echo "Error: JAVA_HOME is not set, cannot proceed." exit -1 fi |