Return-Path: X-Original-To: apmail-zookeeper-commits-archive@www.apache.org Delivered-To: apmail-zookeeper-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A91F818B6E for ; Wed, 20 May 2015 07:29:51 +0000 (UTC) Received: (qmail 87125 invoked by uid 500); 20 May 2015 07:29:51 -0000 Delivered-To: apmail-zookeeper-commits-archive@zookeeper.apache.org Received: (qmail 87097 invoked by uid 500); 20 May 2015 07:29:51 -0000 Mailing-List: contact commits-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ Delivered-To: mailing list commits@zookeeper.apache.org Received: (qmail 87086 invoked by uid 99); 20 May 2015 07:29:51 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 May 2015 07:29:51 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 6AD6AAC0E28 for ; Wed, 20 May 2015 07:29:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1680471 - in /zookeeper/trunk: CHANGES.txt bin/zkEnv.sh Date: Wed, 20 May 2015 07:29:51 -0000 To: commits@zookeeper.apache.org From: rakeshr@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150520072951.6AD6AAC0E28@hades.apache.org> 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