Generated Unix Scripts blindy trust JAVA_HOME
---------------------------------------------

                 Key: MAPPASM-91
                 URL: http://jira.codehaus.org/browse/MAPPASM-91
             Project: Mojo AppAssembler Plugin
          Issue Type: Bug
    Affects Versions: 1.0
         Environment: Linux
            Reporter: Max Berger


The generated Unix launch scripts blindly trust the JAVA_HOME variable, not 
using java in the path even if it is available there. This causes the generated 
scripts to fail on all sites which are misconfigured.

Reproduce:
- set JAVA_HOME to an invalid value
- run a generated unix script.

Possible fix:

if [ -z "$JAVACMD" ] ; then
  if [ -n "$JAVA_HOME"  ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
      # IBM's JDK on AIX uses strange locations for the executables
      JAVACMD="$JAVA_HOME/jre/sh/java"
    else
      JAVACMD="$JAVA_HOME/bin/java"
    fi
  fi
fi

if [ ! -x "$JAVACMD" ] 
  JAVACMD=`which java`
fi

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to