zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rake...@apache.org
Subject svn commit: r1680471 - in /zookeeper/trunk: CHANGES.txt bin/zkEnv.sh
Date Wed, 20 May 2015 07:29:51 GMT
Author: rakeshr
Date: Wed May 20 07:29:50 2015
New Revision: 1680471

URL: http://svn.apache.org/r1680471
Log:
ZOOKEEPER-2156: If JAVA_HOME is not set zk startup and fetching status command execution result
misleads user (J.Andreina via rakeshr)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/bin/zkEnv.sh

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1680471&r1=1680470&r2=1680471&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Wed May 20 07:29:50 2015
@@ -101,6 +101,9 @@ BUGFIXES:
 
   ZOOKEEPER-1077: C client lib doesn't build on Solaris (Chris Nauroth via rgs)
 
+  ZOOKEEPER-2156: If JAVA_HOME is not set zk startup and fetching status command execution
+  result misleads user (J.Andreina via rakeshr)
+
 IMPROVEMENTS:
   ZOOKEEPER-1660 Documentation for Dynamic Reconfiguration (Reed Wanderman-Milne via shralex)
 
 

Modified: zookeeper/trunk/bin/zkEnv.sh
URL: http://svn.apache.org/viewvc/zookeeper/trunk/bin/zkEnv.sh?rev=1680471&r1=1680470&r2=1680471&view=diff
==============================================================================
--- zookeeper/trunk/bin/zkEnv.sh (original)
+++ zookeeper/trunk/bin/zkEnv.sh Wed May 20 07:29:50 2015
@@ -75,10 +75,13 @@ then
     ZOO_LOG4J_PROP="INFO,CONSOLE"
 fi
 
-if [ "$JAVA_HOME" != "" ]; then
-  JAVA="$JAVA_HOME/bin/java"
+if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]];  then
+    JAVA="$JAVA_HOME/bin/java"
+elif type -p java; then
+    JAVA=java
 else
-  JAVA=java
+    echo "Error: JAVA_HOME is not set and java could not be found in PATH." 1>&2
+    exit 1
 fi
 
 #add the zoocfg dir to classpath



Mime
View raw message