[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.
This commit is contained in:
Felix Cheung 2016-12-21 17:24:53 -08:00 committed by Felix Cheung
parent afe36516e4
commit e1b43dc45b

View file

@ -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