-
Enhancement
-
Resolution: Done
-
Major
-
4.1.0.Final
-
None
-
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:
- 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 ${*}