From b03269440cd55861339197e98bfaa7bdf2ef39fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niko=20K=C3=B6bler?= Date: Thu, 16 Dec 2021 12:22:09 +0100 Subject: [PATCH] add JAVA_OPTS_APPEND option from legacy to X (resolves #9188) --- distribution/server-x-dist/src/main/content/bin/kc.bat | 5 +++++ distribution/server-x-dist/src/main/content/bin/kc.sh | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/distribution/server-x-dist/src/main/content/bin/kc.bat b/distribution/server-x-dist/src/main/content/bin/kc.bat index db0b31c0cb..7bdc863289 100644 --- a/distribution/server-x-dist/src/main/content/bin/kc.bat +++ b/distribution/server-x-dist/src/main/content/bin/kc.bat @@ -72,6 +72,11 @@ if not "x%JAVA_OPTS%" == "x" ( set "JAVA_OPTS=-Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true" ) +if not "x%JAVA_OPTS_APPEND%" == "x" ( + echo "Appending additional Java properties to JAVA_OPTS: %JAVA_OPTS_APPEND%" + set "JAVA_OPTS=%JAVA_OPTS% %JAVA_OPTS_APPEND%" +) + if NOT "x%DEBUG%" == "x" ( set "DEBUG_MODE=%DEBUG% ) diff --git a/distribution/server-x-dist/src/main/content/bin/kc.sh b/distribution/server-x-dist/src/main/content/bin/kc.sh index 64e78155e3..ef8e11b63d 100644 --- a/distribution/server-x-dist/src/main/content/bin/kc.sh +++ b/distribution/server-x-dist/src/main/content/bin/kc.sh @@ -68,6 +68,11 @@ else echo "JAVA_OPTS already set in environment; overriding default settings with values: $JAVA_OPTS" fi +if [ "x$JAVA_OPTS_APPEND" != "x" ]; then + echo "Appending additional Java properties to JAVA_OPTS: $JAVA_OPTS_APPEND" + JAVA_OPTS="$JAVA_OPTS $JAVA_OPTS_APPEND" +fi + # Set debug settings if not already set if [ "$DEBUG_MODE" = "true" ]; then DEBUG_OPT=`echo $JAVA_OPTS | $GREP "\-agentlib:jdwp"`