Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-747

Ensure java executable is properly detected for different OSs and JDKs in all shell scripts

XMLWordPrintable

    • Low

      The startServer.sh script currently only invokes "java" directly. The well-known java environment variables like JAVA_HOME are ignored. This raises problems when having a default java installation like gnu gcj 1.42 in the system. Since the linux distribution packages are too old in general, I have e.g. the Oracle JDK unzipped under /opt with JAVA_HOME pointing to it.

      Having JAVA_HOME set in general indicates that this java should be used, so it should be respected.

      The following change would solve this issue:

      1. diff startServer.sh startServer.sh.new
        51c51,59
        < java -cp $CP ${JVM_PARAMS} org.infinispan.server.core.Main ${*}

        > JAVA_EXE=java
        > if [ ! -z "$JAVA_HOME" ]; then
        > JAVA_EXE=$JAVA_HOME/bin/java
        > elif [ ! -z "$JDK_HOME" ]; then
        > JAVA_EXE=$JDK_HOME/bin/java
        > elif [ ! -z "$JRE_HOME" ]; then
        > JAVA_EXE=$JRE_HOME/bin/java
        > fi
        > $JAVA_EXE -cp $CP ${JVM_PARAMS} org.infinispan.server.core.Main ${*}

              manik_jira Manik Surtani (Inactive)
              tsarnowski_jira Tobias Sarnowski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: