activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [activemq] branch activemq-5.15.x updated: Improve activemq init JAVACMD auto detection
Date Fri, 18 Oct 2019 17:11:59 GMT
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch activemq-5.15.x
in repository

The following commit(s) were added to refs/heads/activemq-5.15.x by this push:
     new d3be100  Improve activemq init JAVACMD auto detection
d3be100 is described below

commit d3be100dbfcd0c872f527a087912a51df3d0fada
Author: J. Lewis Muir <>
AuthorDate: Fri Sep 27 14:59:13 2019 -0500

    Improve activemq init JAVACMD auto detection
    If JAVACMD is set to "auto" (the default from the "env" file) and
    the current working directory contains a directory named "auto", the
    activemq init script will incorrectly detect the "auto" directory as the
    "java" binary thus leaving JAVACMD set to "auto" which is incorrect and
    will obviously fail to execute the Java VM.
    To fix this, in the second attempt to detect the "java" binary, repeat
    the tests for a zero-length JAVACMD or a JAVACMD equal to "auto" before
    testing whether JAVACMD does not exist or is not executable.  This is
    necessary because when JAVA_HOME's length is zero, the first attempt to
    detect the location of the "java" binary will not set JAVACMD (so it
    will still be "auto" when it reaches the second auto-detection attempt).
    (cherry picked from commit 3df12a15b1a21747ac51548e7be95ba72e55d449)
 assembly/src/release/bin/activemq | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/assembly/src/release/bin/activemq b/assembly/src/release/bin/activemq
index 358204b..c8d7f03 100755
--- a/assembly/src/release/bin/activemq
+++ b/assembly/src/release/bin/activemq
@@ -245,7 +245,7 @@ if [ -z "$JAVACMD" ] || [ "$JAVACMD" = "auto" ] ; then
 # Hm, we still do not know the location of the java binary
-if [ ! -x "$JAVACMD" ] ; then
+if [ -z "$JAVACMD" ] || [ "$JAVACMD" = "auto" ] || [ ! -x "$JAVACMD" ] ; then
     JAVACMD=`which java 2> /dev/null `
     if [ -z "$JAVACMD" ] ; then

View raw message