寻找JAVA_HOME find java

 

more apache-flume-1.8.0-bin/bin/flume-ng

 

 

# find java
if [ -z "${JAVA_HOME}" ] ; then
  warn "JAVA_HOME is 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
  fi

  # Using java from path if bigtop is not installed or couldn't find it
  if [ -z "${JAVA_HOME}" ] ; then
    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

  

 

 

https://issues.apache.org/jira/secure/attachment/12533059/FLUME-1154_4.patch

 

[FLUME-1154] flume-ng script should first try finding java from PATH and then try using bigtop, instead of vice-versa - ASF JIRA https://issues.apache.org/jira/browse/FLUME-1154

 

posted @ 2018-08-07 16:18  papering  阅读(995)  评论(0编辑  收藏  举报