flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject svn commit: r1353256 - /incubator/flume/trunk/bin/flume-ng
Date Sun, 24 Jun 2012 12:47:47 GMT
Author: mpercy
Date: Sun Jun 24 12:47:47 2012
New Revision: 1353256

URL: http://svn.apache.org/viewvc?rev=1353256&view=rev
Log:
FLUME-1154. Improve how JAVA_HOME is found at startup time.

(Leslin (Hong Xiang Lin) via Mike Percy)

Modified:
    incubator/flume/trunk/bin/flume-ng

Modified: incubator/flume/trunk/bin/flume-ng
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/bin/flume-ng?rev=1353256&r1=1353255&r2=1353256&view=diff
==============================================================================
--- incubator/flume/trunk/bin/flume-ng (original)
+++ incubator/flume/trunk/bin/flume-ng Sun Jun 24 12:47:47 2012
@@ -311,21 +311,22 @@ fi
 
 # find java
 if [ -z "${JAVA_HOME}" ] ; then
-  echo "Warning: JAVA_HOME not set!"
+  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
+  if [ -e /usr/libexec/bigtop-detect-javahome ] ; then
     . /usr/libexec/bigtop-detect-javahome
-  elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
+  elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ] ; then
     . /usr/lib/bigtop-utils/bigtop-detect-javahome
-  else
-    JAVA_DEFAULT=`type -p java`
+  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
 
-[ -n "${JAVA_HOME}" ] || error "Unable to find a suitable JAVA_HOME" 1
-
 # look for hadoop libs
 add_hadoop_paths
 add_HBASE_paths



Mime
View raw message