From e1b43dc45b136a89f105c04c3074233f52568152 Mon Sep 17 00:00:00 2001 From: Felix Cheung Date: Wed, 21 Dec 2016 17:24:53 -0800 Subject: [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 Closes #16363 from felixcheung/buildjava. --- dev/make-distribution.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dev/make-distribution.sh') 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 -- cgit v1.2.3