Set the default locale for the JVM to English to prevent locale-specific character variations

* introduced the JAVA_LOCALE variable within kc.sh|bat in order to control JVM locale

Closes #26438

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
This commit is contained in:
Peter Zaoral 2024-03-12 22:27:12 +01:00 committed by Peter Zaoral
parent adf838f81f
commit f40bf4ca2a
2 changed files with 16 additions and 0 deletions

View file

@ -105,6 +105,14 @@ if not "x%JAVA_ADD_OPENS%" == "x" (
)
set "JAVA_OPTS=%JAVA_OPTS% %JAVA_ADD_OPENS%"
@REM Set the default locale for the JVM to English to prevent locale-specific character variations
if not "x%JAVA_LOCALE%" == "x" (
echo "JAVA_LOCALE already set in environment; overriding default settings with values: %JAVA_LOCALE%"
) else (
set "JAVA_LOCALE=-Duser.language=en -Duser.country=US"
)
set "JAVA_OPTS=%JAVA_OPTS% %JAVA_LOCALE%"
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%

View file

@ -126,6 +126,14 @@ else
fi
JAVA_OPTS="$JAVA_OPTS $JAVA_ADD_OPENS"
# Set the default locale for the JVM to English to prevent locale-specific character variations
if [ -z "$JAVA_LOCALE" ]; then
JAVA_LOCALE="-Duser.language=en -Duser.country=US"
else
echo "JAVA_LOCALE already set in environment; overriding default settings with values: $JAVA_LOCALE"
fi
JAVA_OPTS="$JAVA_OPTS $JAVA_LOCALE"
if [ -n "$JAVA_OPTS_APPEND" ]; then
echo "Appending additional Java properties to JAVA_OPTS: $JAVA_OPTS_APPEND"
JAVA_OPTS="$JAVA_OPTS $JAVA_OPTS_APPEND"