Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit cc538b3

Browse files
committed
Allow specifying JAVA_HOME relative to $AppPackageFolder
One may wish, for example, to bundle the JRE with their application. When doing so, it is helpful to specify the `JAVA_HOME` relative to the application package folder. This patch will prepend `$AppPackageFolder` to `JAVA_HOME` when looking for `JAVACMD` - but *ONLY* if `JAVA_HOME` is a relative path (doesn't start with `/`). This allows you to set a relative `JAVA_HOME` using `<lsenvironment>` and it will get picked up.
1 parent 76222cd commit cc538b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/universalJavaApplicationStub

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ oracle_jre_version=`extractJavaMajorVersion "${oracle_jre_plugin}"`
302302

303303
# first check system variable "$JAVA_HOME"
304304
if [ -n "$JAVA_HOME" ] ; then
305-
JAVACMD="$JAVA_HOME/bin/java"
305+
if [[ $JAVA_HOME == /* ]] ; then
306+
JAVACMD="$JAVA_HOME/bin/java"
307+
else
308+
JAVACMD="$AppPackageFolder/$JAVA_HOME/bin/java"
309+
fi
306310

307311
# check for JVMversion requirements
308312
elif [ ! -z ${JVMVersion} ] ; then

0 commit comments

Comments
 (0)