diff options
author | Felix Cheung <felixcheung_m@hotmail.com> | 2016-12-21 17:24:53 -0800 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2016-12-21 17:24:53 -0800 |
commit | e1b43dc45b136a89f105c04c3074233f52568152 (patch) | |
tree | bbed5ac0ea888db609adfb5f1fe340bf0f5c39d1 /dev/make-distribution.sh | |
parent | afe36516e4b4031196ee2e0a04980ac49208ea6b (diff) | |
download | spark-e1b43dc45b136a89f105c04c3074233f52568152.tar.gz spark-e1b43dc45b136a89f105c04c3074233f52568152.tar.bz2 spark-e1b43dc45b136a89f105c04c3074233f52568152.zip |
[BUILD] make-distribution should find JAVA_HOME for non-RHEL systems
## What changes were proposed in this pull request?
make-distribution.sh should find JAVA_HOME for Ubuntu, Mac and other non-RHEL systems
## How was this patch tested?
Manually
Author: Felix Cheung <felixcheung_m@hotmail.com>
Closes #16363 from felixcheung/buildjava.
Diffstat (limited to 'dev/make-distribution.sh')
-rwxr-xr-x | dev/make-distribution.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dev/make-distribution.sh b/dev/make-distribution.sh index 6ea319e436..6c5ae0d629 100755 --- a/dev/make-distribution.sh +++ b/dev/make-distribution.sh @@ -102,6 +102,13 @@ if [ -z "$JAVA_HOME" ]; then echo "No JAVA_HOME set, proceeding with '$JAVA_HOME' learned from rpm" fi fi + + if [ -z "$JAVA_HOME" ]; then + if [ `command -v java` ]; then + # If java is in /usr/bin/java, we want /usr + JAVA_HOME="$(dirname $(dirname $(which java)))" + fi + fi fi if [ -z "$JAVA_HOME" ]; then |