Description
Please see bin/flume-ng script, under the "#find java" section.
It says:
- find java
if [ -z "${JAVA_HOME}" ] ; then
echo "Warning: JAVA_HOME not set!" - Try to use Bigtop to autodetect JAVA_HOME if it's available
if [ -e /usr/libexec/bigtop-detect-javahome ]; then
. /usr/libexec/bigtop-detect-javahome
elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
. /usr/lib/bigtop-utils/bigtop-detect-javahome
else
JAVA_DEFAULT=`type -p java`
[ -n "$JAVA_DEFAULT" ] || error "Unable to find java executable. Is it in your PATH?" 1
JAVA_HOME=$(cd $(dirname $JAVA_DEFAULT)/..; pwd)
fi
fi
[ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
...and this means that if bigtop-detect-javahome was unable to located a java executable. This could happen if the user stores the JDK under his/her own dir in something like /home/<user>/tools/jdk1.6.0_26. The user could have the JDK bin dir in his/her path, but may not necessarily have set JAVA_HOME. If there are no other JDK's available for bigtop-utils to detect, then the current flume-ng script will fail with error saying "Unable to find a suitable JAVA_HOME", even though the java executable was in the PATH.
So, I recommend doing the "type -p java" check first, and if that results in no match then try bigtop-detect-javahome.