From f12db20ac979dd7fa05949f57236a5fd95ddbce3 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Wed, 10 Jul 2024 12:35:48 +0200 Subject: [PATCH] Add Java 21 support + fix Java 8 --- Dockerfile | 2 +- config.example.env | 3 ++- entrypoint.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24003db..7dde774 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ LABEL org.opencontainers.image.licenses="GPL-3.0-only" RUN true RUN nice -20 apk update RUN nice -20 apk upgrade -RUN nice -20 apk add bash libstdc++ openjdk21-jre openjdk17-jre openjdk11-jre +RUN nice -20 apk add bash libstdc++ openjdk21-jre openjdk17-jre openjdk11-jre openjdk8-jre RUN mkdir /app ADD entrypoint.sh /app/entrypoint.sh COPY --from=builder /builder/bin/rcon /usr/bin/rcon diff --git a/config.example.env b/config.example.env index 160fa7f..0d14832 100644 --- a/config.example.env +++ b/config.example.env @@ -44,7 +44,8 @@ MCSD_MEMORY_MIN=2048M ## <= 1.16 | 8 ## <= 1.16 | 11 (may increase performance) ## >= 1.17 | 17 -MCSD_JAVA_VERSION=17 +## >= 1.20.5 | 21 +MCSD_JAVA_VERSION=21 # OPTIMIZED_FLAGS ## Applies a modified variant of Aikar's Flags diff --git a/entrypoint.sh b/entrypoint.sh index 3a3373b..d7f7e97 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -71,7 +71,7 @@ function initialize() { exit 1 fi # Java version - if [ ! "${MCSD_JAVA_VERSION}" == "17" ] && [ ! "${MCSD_JAVA_VERSION}" == "11" ] && [ ! "${MCSD_JAVA_VERSION}" == "8" ]; then + if [ ! "${MCSD_JAVA_VERSION}" == "21" ] && [ ! "${MCSD_JAVA_VERSION}" == "17" ] && [ ! "${MCSD_JAVA_VERSION}" == "11" ] && [ ! "${MCSD_JAVA_VERSION}" == "8" ]; then echo ":: Warning: No/Invalid java version supplied to \$MCSD_JAVA_VERSION, defaulting to java version 17" export "MCSD_JAVA_VERSION=17" fi @@ -156,7 +156,7 @@ function compile_flags() { internal_error "\$MCSD_GARBAGECOLLECTOR has invalid value" ;; esac - if [ "${MCSD_JAVA_VERSION}" == "17" ]; then + if [ "${MCSD_JAVA_VERSION}" == "17" ] || [ "${MCSD_JAVA_VERSION}" == "21" ]; then export "FLAGS=${FLAGS} --add-modules=jdk.incubator.vector" fi }