This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new d7020fbec3 Require Java 17+ for building and running Bookkeeper (#4446)
d7020fbec3 is described below

commit d7020fbec37d207eae0a042d702ae981e7fdeb79
Author: Lari Hotari <[email protected]>
AuthorDate: Thu Mar 5 10:34:28 2026 +0200

    Require Java 17+ for building and running Bookkeeper (#4446)
---
 .github/workflows/bk-ci.yml                        |  35 +++--
 .github/workflows/bk-streamstorage-python.yml      |   4 +-
 .github/workflows/codeql.yml                       |   4 +-
 .github/workflows/website-deploy.yaml              |   4 +-
 .github/workflows/website-pr-validation.yml        |   4 +-
 .github/workflows/windows-daily-build.yml          |   2 +-
 bin/common.sh                                      |  99 +++++---------
 dev/docker/Dockerfile                              |   2 +-
 dev/release/Dockerfile                             |   2 +-
 pom.xml                                            | 147 +++++++++++----------
 site3/website/docs/getting-started/installation.md |   2 +-
 .../all-released-versions-image/Dockerfile         |   6 +-
 .../scripts/install-tarball.sh                     |  16 ++-
 tests/docker-images/all-versions-image/Dockerfile  |   9 ++
 .../scripts/install-all-tarballs.sh                |  87 ------------
 tests/integration-tests-base-groovy/pom.xml        |   4 +
 .../tests/integration/utils/MavenClassLoader.java  |   6 +-
 tests/pom.xml                                      |   2 +-
 tests/scripts/src/test/bash/bk_test_bin_common.sh  |  30 +----
 .../cli/commands/cluster/InitClusterCommand.java   |   2 +-
 20 files changed, 179 insertions(+), 288 deletions(-)

diff --git a/.github/workflows/bk-ci.yml b/.github/workflows/bk-ci.yml
index 101b4186e1..625f87e844 100644
--- a/.github/workflows/bk-ci.yml
+++ b/.github/workflows/bk-ci.yml
@@ -73,12 +73,12 @@ jobs:
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         if: steps.check_changes.outputs.docs_only != 'true'
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
       - name: Validate pull request
         if: steps.check_changes.outputs.docs_only != 'true'
@@ -151,11 +151,11 @@ jobs:
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
       - name: Tune Java DNS TTL settings
         run: |
@@ -232,11 +232,11 @@ jobs:
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
       - name: Tune Java DNS TTL settings
         run: |
@@ -300,7 +300,8 @@ jobs:
 
   backward-compatibility-tests:
     name: Backward compatibility tests
-    runs-on: ubuntu-latest
+    # The old Arquillian requires an old version of Docker Engine, so we need 
to run it on ubuntu-22.04
+    runs-on: ubuntu-22.04
     timeout-minutes: 75
     needs: [ 'build-and-license-check' ]
     if: ${{ needs.build-and-license-check.outputs.docs_only != 'true' }}
@@ -326,11 +327,11 @@ jobs:
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
 
-      - name: Set up JDK 8
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 8
+          java-version: 17
 
       - name: Pick ubuntu mirror for the docker image build
         run: |
@@ -383,7 +384,7 @@ jobs:
           retention-days: 7
 
   windows-build:
-    name: Build with windows on JDK 11
+    name: Build with windows on JDK 17
     runs-on: windows-latest
     timeout-minutes: 30
     needs: [ 'build-and-license-check' ]
@@ -408,17 +409,17 @@ jobs:
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
       - name: mvn package
         run: mvn -B -nsu clean package -DskipTests
 
   macos-build:
-    name: Build with macos on JDK 11
+    name: Build with macos on JDK 17
     runs-on: macos-latest
     timeout-minutes: 30
     needs: [ 'build-and-license-check' ]
@@ -440,11 +441,11 @@ jobs:
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
       - name: mvn package
         run: mvn -B -nsu clean package -DskipTests
@@ -459,10 +460,6 @@ jobs:
       fail-fast: false
       matrix:
         include:
-          - step_name: Compatibility Check Java8
-            jdk_version: 8
-          - step_name: Compatibility Check Java11
-            jdk_version: 11
           - step_name: Compatibility Check Java17
             jdk_version: 17
           - step_name: Compatibility Check Java21
diff --git a/.github/workflows/bk-streamstorage-python.yml 
b/.github/workflows/bk-streamstorage-python.yml
index 71dbe61045..cb8f17c060 100644
--- a/.github/workflows/bk-streamstorage-python.yml
+++ b/.github/workflows/bk-streamstorage-python.yml
@@ -66,11 +66,11 @@ jobs:
             !~/.m2/repository/org/apache/bookkeeper
             !~/.m2/repository/org/apache/distributedlog
           key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
       - name: Build
         run: mvn -q -T 1C -B -nsu clean install -DskipTests -Dcheckstyle.skip 
-Dspotbugs.skip -Drat.skip -Dmaven.javadoc.skip
       - name: Pick ubuntu mirror for the docker image build
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index e838fccc36..156468c5f3 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -78,12 +78,12 @@ jobs:
       with:
         languages: ${{ matrix.language }}
 
-    - name: Set up JDK 11
+    - name: Set up JDK 17
       if: steps.check_changes.outputs.docs_only != 'true'
       uses: actions/setup-java@v4
       with:
         distribution: 'temurin'
-        java-version: 11
+        java-version: 17
 
     - name: Validate pull request
       if: steps.check_changes.outputs.docs_only != 'true'
diff --git a/.github/workflows/website-deploy.yaml 
b/.github/workflows/website-deploy.yaml
index 868b1db0c7..0359ebf5fa 100644
--- a/.github/workflows/website-deploy.yaml
+++ b/.github/workflows/website-deploy.yaml
@@ -40,11 +40,11 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v4
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
 
       - name: Setup NodeJS
diff --git a/.github/workflows/website-pr-validation.yml 
b/.github/workflows/website-pr-validation.yml
index 9d38cb59f2..b439a3d93b 100644
--- a/.github/workflows/website-pr-validation.yml
+++ b/.github/workflows/website-pr-validation.yml
@@ -37,11 +37,11 @@ jobs:
       - name: Checkout
         uses: actions/checkout@v4
 
-      - name: Set up JDK 11
+      - name: Set up JDK 17
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
-          java-version: 11
+          java-version: 17
 
 
       - name: Setup NodeJS
diff --git a/.github/workflows/windows-daily-build.yml 
b/.github/workflows/windows-daily-build.yml
index ff130de29a..c367065e3e 100644
--- a/.github/workflows/windows-daily-build.yml
+++ b/.github/workflows/windows-daily-build.yml
@@ -27,7 +27,7 @@ jobs:
     runs-on: windows-latest
     steps:
       - uses: actions/checkout@v4
-      - name: Set up JDK 17
+      - name: Set up JDK 21
         uses: actions/setup-java@v4
         with:
           distribution: 'temurin'
diff --git a/bin/common.sh b/bin/common.sh
index fd9bd2f0b8..37bcdff571 100755
--- a/bin/common.sh
+++ b/bin/common.sh
@@ -68,43 +68,34 @@ source ${BK_CONFDIR}/nettyenv.sh
 source ${BK_CONFDIR}/bkenv.sh
 source ${BK_CONFDIR}/bk_cli_env.sh
 
-detect_jdk8() {
-  local is_java_8=$($JAVA -version 2>&1 | grep version | grep '"1\.8')
-  if [ -z "$is_java_8" ]; then
-     echo "0"
-  else
-     echo "1"
-  fi
-}
+for token in $("$JAVA" -version 2>&1 | grep 'version "'); do
+    if [[ $token =~ \"([[:digit:]]+)\.([[:digit:]]+)(.*)\" ]]; then
+        if [[ ${BASH_REMATCH[1]} == "1" ]]; then
+          JAVA_MAJOR_VERSION=${BASH_REMATCH[2]}
+        else
+          JAVA_MAJOR_VERSION=${BASH_REMATCH[1]}
+        fi
+        break
+    elif [[ $token =~ \"([[:digit:]]+)(.*)\" ]]; then
+        # Process the java versions without dots, such as `17-internal`.
+        JAVA_MAJOR_VERSION=${BASH_REMATCH[1]}
+        break
+    fi
+done
+
+if [[ $JAVA_MAJOR_VERSION -lt 17 ]]; then
+    echo "Error: BookKeeper requires Java 17 or later." 1>&2
+    exit 1
+fi
 
 # default netty settings
 NETTY_LEAK_DETECTION_LEVEL=${NETTY_LEAK_DETECTION_LEVEL:-"disabled"}
 
-USING_JDK8=$(detect_jdk8)
-
-if [ "$USING_JDK8" -ne "1" ]; then
-   DEFAULT_BOOKIE_GC_OPTS="-XX:+UseG1GC \
-    -XX:MaxGCPauseMillis=10 \
-    -XX:+ParallelRefProcEnabled \
-    -XX:+DisableExplicitGC"
-   DEFAULT_BOOKIE_GC_LOGGING_OPTS=""
-else
-  DEFAULT_BOOKIE_GC_OPTS="-XX:+UseG1GC \
-    -XX:MaxGCPauseMillis=10 \
-    -XX:+ParallelRefProcEnabled \
-    -XX:+UnlockExperimentalVMOptions \
-    -XX:+DoEscapeAnalysis \
-    -XX:ParallelGCThreads=32 \
-    -XX:ConcGCThreads=32 \
-    -XX:G1NewSizePercent=50 \
-    -XX:+DisableExplicitGC \
-    -XX:-ResizePLAB"
-  DEFAULT_BOOKIE_GC_LOGGING_OPTS="-XX:+PrintGCDetails \
-    -XX:+PrintGCApplicationStoppedTime  \
-    -XX:+UseGCLogFileRotation \
-    -XX:NumberOfGCLogFiles=5 \
-    -XX:GCLogFileSize=64m"
-fi
+DEFAULT_BOOKIE_GC_OPTS="-XX:+UseG1GC \
+-XX:MaxGCPauseMillis=10 \
+-XX:+ParallelRefProcEnabled \
+-XX:+DisableExplicitGC"
+DEFAULT_BOOKIE_GC_LOGGING_OPTS=""
 
 BOOKIE_MAX_HEAP_MEMORY=${BOOKIE_MAX_HEAP_MEMORY:-"1g"}
 BOOKIE_MIN_HEAP_MEMORY=${BOOKIE_MIN_HEAP_MEMORY:-"1g"}
@@ -116,15 +107,7 @@ 
BOOKIE_GC_LOGGING_OPTS=${BOOKIE_GC_LOGGING_OPTS:-"${DEFAULT_BOOKIE_GC_LOGGING_OP
 # default CLI JVM settings
 DEFAULT_CLI_GC_OPTS="-XX:+UseG1GC \
     -XX:MaxGCPauseMillis=10"
-if [ "$USING_JDK8" -ne "1" ]; then
-  DEFAULT_CLI_GC_LOGGING_OPTS=""
-else
-  DEFAULT_CLI_GC_LOGGING_OPTS="-XX:+PrintGCDetails \
-    -XX:+PrintGCApplicationStoppedTime  \
-    -XX:+UseGCLogFileRotation \
-    -XX:NumberOfGCLogFiles=5 \
-    -XX:GCLogFileSize=64m"
-fi
+DEFAULT_CLI_GC_LOGGING_OPTS=""
 
 CLI_MAX_HEAP_MEMORY=${CLI_MAX_HEAP_MEMORY:-"512M"}
 CLI_MIN_HEAP_MEMORY=${CLI_MIN_HEAP_MEMORY:-"256M"}
@@ -260,34 +243,24 @@ set_module_classpath() {
 build_bookie_jvm_opts() {
   LOG_DIR=$1
   GC_LOG_FILENAME=$2
-  if [ "$USING_JDK8" -eq "1" ]; then
-    echo "$BOOKIE_MEM_OPTS $BOOKIE_GC_OPTS $BOOKIE_GC_LOGGING_OPTS 
$BOOKIE_PERF_OPTS -Xloggc:${LOG_DIR}/${GC_LOG_FILENAME}"
-  else
-    echo "$BOOKIE_MEM_OPTS $BOOKIE_GC_OPTS $BOOKIE_GC_LOGGING_OPTS 
$BOOKIE_PERF_OPTS 
-Xlog:gc=info:file=${LOG_DIR}/${GC_LOG_FILENAME}::filecount=5,filesize=64m"
-  fi
+  echo "$BOOKIE_MEM_OPTS $BOOKIE_GC_OPTS $BOOKIE_GC_LOGGING_OPTS 
$BOOKIE_PERF_OPTS 
-Xlog:gc=info:file=${LOG_DIR}/${GC_LOG_FILENAME}::filecount=5,filesize=64m"
   return
 }
 
 build_cli_jvm_opts() {
   LOG_DIR=$1
   GC_LOG_FILENAME=$2
-  if [ "$USING_JDK8" -eq "1" ]; then
-    echo "$CLI_MEM_OPTS $CLI_GC_OPTS $CLI_GC_LOGGING_OPTS 
-Xloggc:${LOG_DIR}/${GC_LOG_FILENAME}"
-  else
-    echo "$CLI_MEM_OPTS $CLI_GC_OPTS $CLI_GC_LOGGING_OPTS 
-Xlog:gc=info:file=${LOG_DIR}/${GC_LOG_FILENAME}::filecount=5,filesize=64m"
-  fi
+  echo "$CLI_MEM_OPTS $CLI_GC_OPTS $CLI_GC_LOGGING_OPTS 
-Xlog:gc=info:file=${LOG_DIR}/${GC_LOG_FILENAME}::filecount=5,filesize=64m"
   return
 }
 
 build_netty_opts() {
   NETTY_OPTS="-Dio.netty.leakDetectionLevel=${NETTY_LEAK_DETECTION_LEVEL} 
-Dio.netty.tryReflectionSetAccessible=true"
   # --add-opens does not exist on jdk8
-  if [ "$USING_JDK8" -eq "0" ]; then
-    # Enable java.nio.DirectByteBuffer
-    # 
https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/internal/PlatformDependent0.java
-    # https://github.com/netty/netty/issues/12265
-    NETTY_OPTS="$NETTY_OPTS --add-opens java.base/java.nio=ALL-UNNAMED 
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED"
-  fi
+  # Enable java.nio.DirectByteBuffer
+  # 
https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/internal/PlatformDependent0.java
+  # https://github.com/netty/netty/issues/12265
+  NETTY_OPTS="$NETTY_OPTS --add-opens java.base/java.nio=ALL-UNNAMED 
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED"
   echo $NETTY_OPTS
 }
 
@@ -322,12 +295,10 @@ build_cli_logging_opts() {
 build_bookie_opts() {
   BOOKIE_OPTS="-Djava.net.preferIPv4Stack=true"
   # --add-opens does not exist on jdk8
-  if [ "$USING_JDK8" -eq "0" ]; then
-    # enable posix_fadvise usage in the Journal
-    BOOKIE_OPTS="$BOOKIE_OPTS --add-opens java.base/java.io=ALL-UNNAMED"
-    # DirectMemoryCRC32Digest
-    BOOKIE_OPTS="$BOOKIE_OPTS --add-opens java.base/java.util.zip=ALL-UNNAMED"
-  fi
+  # enable posix_fadvise usage in the Journal
+  BOOKIE_OPTS="$BOOKIE_OPTS --add-opens java.base/java.io=ALL-UNNAMED"
+  # DirectMemoryCRC32Digest
+  BOOKIE_OPTS="$BOOKIE_OPTS --add-opens java.base/java.util.zip=ALL-UNNAMED"
   echo $BOOKIE_OPTS
 }
 
diff --git a/dev/docker/Dockerfile b/dev/docker/Dockerfile
index a23a363bee..0b2661059e 100644
--- a/dev/docker/Dockerfile
+++ b/dev/docker/Dockerfile
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-FROM maven:3.9.0-eclipse-temurin-11
+FROM maven:3.9.11-eclipse-temurin-17
 
 RUN apt-get update
 RUN apt-get install -y g++ cmake
diff --git a/dev/release/Dockerfile b/dev/release/Dockerfile
index 23c28954c1..81745e0bac 100644
--- a/dev/release/Dockerfile
+++ b/dev/release/Dockerfile
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-FROM --platform=linux/amd64 maven:3.9.0-eclipse-temurin-8
+FROM --platform=linux/amd64 maven:3.9.11-eclipse-temurin-17
 ARG DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && \
   apt-get dist-upgrade -y && \
diff --git a/pom.xml b/pom.xml
index 33b6928564..2f6636120a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -106,14 +106,36 @@
     </developer>
   </developers>
   <properties>
-    <maven.compiler.source>8</maven.compiler.source>
-    <maven.compiler.target>8</maven.compiler.target>
+    <maven.compiler.source>17</maven.compiler.source>
+    <maven.compiler.target>17</maven.compiler.target>
+    <maven.compiler.release>17</maven.compiler.release>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     <redirectTestOutputToFile>true</redirectTestOutputToFile>
     <testRetryCount>2</testRetryCount>
     <src.dir>src/main/java</src.dir>
-    <test.additional.args />
+    <test.additional.args>
+      --add-opens java.base/java.io=ALL-UNNAMED
+      --add-opens java.base/java.lang=ALL-UNNAMED
+      --add-opens java.base/java.lang.reflect=ALL-UNNAMED
+      --add-opens java.base/java.net=ALL-UNNAMED
+      --add-opens java.base/java.nio=ALL-UNNAMED
+      --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
+      --add-opens java.base/java.nio.file=ALL-UNNAMED
+      --add-opens java.base/java.util=ALL-UNNAMED
+      --add-opens java.base/java.util.concurrent=ALL-UNNAMED
+      --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
+      --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED
+      --add-opens java.base/java.util.stream=ALL-UNNAMED
+      --add-opens java.base/java.util.zip=ALL-UNNAMED
+      --add-opens java.base/java.time=ALL-UNNAMED
+      --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
+      --add-opens java.base/sun.net.dns=ALL-UNNAMED
+      --add-opens java.base/sun.nio.ch=ALL-UNNAMED
+      --add-opens java.base/sun.security.jca=ALL-UNNAMED
+      --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED
+      --add-opens java.desktop/java.beans=ALL-UNNAMED
+    </test.additional.args>
 
     <!-- dependencies -->
     <arquillian-cube.version>1.18.2</arquillian-cube.version>
@@ -154,7 +176,7 @@
     <assertj-core.version>3.25.3</assertj-core.version>
     <awaitility.version>4.2.0</awaitility.version>
     <libthrift.version>0.14.2</libthrift.version>
-    <lombok.version>1.18.32</lombok.version>
+    <lombok.version>1.18.42</lombok.version>
     <log4j.version>2.23.1</log4j.version>
     <lz4-java.version>1.10.2</lz4-java.version>
     <mockito.version>4.11.0</mockito.version>
@@ -192,8 +214,9 @@
     <lombok-maven-plugin.version>1.18.20.0</lombok-maven-plugin.version>
     <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
     <maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
-    <maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
-    <maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
+    <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
+    <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
+    <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
     <dependency-check-maven.version>12.1.0</dependency-check-maven.version>
     <nar-maven-plugin.version>3.10.1</nar-maven-plugin.version>
     <os-maven-plugin.version>1.7.1</os-maven-plugin.version>
@@ -940,6 +963,26 @@
     </extensions>
     <pluginManagement>
       <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>${maven-compiler-plugin.version}</version>
+          <configuration>
+            <encoding>UTF-8</encoding>
+            <showDeprecation>true</showDeprecation>
+            <showWarnings>true</showWarnings>
+            <annotationProcessorPaths>
+              <path>
+                <groupId>org.projectlombok</groupId>
+                <artifactId>lombok</artifactId>
+                <version>${lombok.version}</version>
+              </path>
+            </annotationProcessorPaths>
+            <compilerArgs>
+              <arg>-parameters</arg>
+            </compilerArgs>
+          </configuration>
+        </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-checkstyle-plugin</artifactId>
@@ -1000,6 +1043,31 @@
       </plugins>
     </pluginManagement>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>${maven-enforcer-plugin.version}</version>
+        <executions>
+          <execution>
+            <id>enforce-maven</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>
+            <configuration>
+              <rules>
+                <requireJavaVersion>
+                  <version>[17,18),[21,22),[25,26)</version>
+                  <message>Java 17, 21 or 25 is required to build 
Bookkeeper.</message>
+                </requireJavaVersion>
+                <requireMavenVersion>
+                  <version>3.6.1</version>
+                  <message>Maven 3.6.1 or newer is required to build 
Bookkeeper.</message>
+                </requireMavenVersion>
+              </rules>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>com.github.spotbugs</groupId>
         <artifactId>spotbugs-maven-plugin</artifactId>
@@ -1008,26 +1076,6 @@
           
<excludeFilterFile>${session.executionRootDirectory}/buildtools/src/main/resources/bookkeeper/findbugsExclude.xml</excludeFilterFile>
         </configuration>
       </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <version>${maven-compiler-plugin.version}</version>
-        <configuration>
-          <encoding>UTF-8</encoding>
-          <showDeprecation>true</showDeprecation>
-          <showWarnings>true</showWarnings>
-          <annotationProcessorPaths>
-            <path>
-              <groupId>org.projectlombok</groupId>
-              <artifactId>lombok</artifactId>
-              <version>${lombok.version}</version>
-            </path>
-          </annotationProcessorPaths>
-          <compilerArgs>
-            <arg>-parameters</arg>
-          </compilerArgs>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
@@ -1383,53 +1431,6 @@
         <nar.aolProperties>src/aarch64_aol.properties</nar.aolProperties>
       </properties>
     </profile>
-    <profile>
-      <id>jdk11</id>
-      <activation>
-        <jdk>[11,)</jdk>
-      </activation>
-      <properties>
-        <!-- prevents silent NoSuchMethodErrors that happen at runtime on Java 
8 -->
-        <!-- see https://github.com/apache/bookkeeper/issues/4202 -->
-        
<maven.compiler.release>${maven.compiler.target}</maven.compiler.release>
-        <!-- required for running tests on Java 11+ -->
-        <test.additional.args>
-          --add-opens java.base/java.io=ALL-UNNAMED
-          --add-opens java.base/java.lang=ALL-UNNAMED
-          --add-opens java.base/java.lang.reflect=ALL-UNNAMED
-          --add-opens java.base/java.net=ALL-UNNAMED
-          --add-opens java.base/java.nio=ALL-UNNAMED
-          --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
-          --add-opens java.base/java.nio.file=ALL-UNNAMED
-          --add-opens java.base/java.util=ALL-UNNAMED
-          --add-opens java.base/java.util.concurrent=ALL-UNNAMED
-          --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
-          --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED
-          --add-opens java.base/java.util.stream=ALL-UNNAMED
-          --add-opens java.base/java.util.zip=ALL-UNNAMED
-          --add-opens java.base/java.time=ALL-UNNAMED
-          --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
-          --add-opens java.base/sun.net.dns=ALL-UNNAMED
-          --add-opens java.base/sun.nio.ch=ALL-UNNAMED
-          --add-opens java.base/sun.security.jca=ALL-UNNAMED
-          --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED
-        </test.additional.args>
-      </properties>
-      <build>
-        <pluginManagement>
-          <plugins>
-            <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-compiler-plugin</artifactId>
-              <configuration>
-                <!-- for some reason, setting maven.compiler.release property 
alone doesn't work -->
-                <release>${maven.compiler.release}</release>
-              </configuration>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-      </build>
-    </profile>
     <profile>
       <id>apache-release</id>
       <build>
diff --git a/site3/website/docs/getting-started/installation.md 
b/site3/website/docs/getting-started/installation.md
index c3972837f1..47bbbf0723 100644
--- a/site3/website/docs/getting-started/installation.md
+++ b/site3/website/docs/getting-started/installation.md
@@ -8,7 +8,7 @@ You can install BookKeeper either by [downloading](#download) a 
[GZipped](http:/
 ## Requirements
 
 * [Unix environment](https://www.opengroup.org/membership/forums/platform/unix)
-* [Java Development Kit 
1.8](http://www.oracle.com/technetwork/java/javase/downloads/index.html) or 
later
+* [Java Development Kit 
17](https://adoptium.net/temurin/releases?version=17&os=any&arch=any) or later
 
 ## Download
 
diff --git a/tests/docker-images/all-released-versions-image/Dockerfile 
b/tests/docker-images/all-released-versions-image/Dockerfile
index 7da3aeca5e..80721ac0b6 100644
--- a/tests/docker-images/all-released-versions-image/Dockerfile
+++ b/tests/docker-images/all-released-versions-image/Dockerfile
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-FROM eclipse-temurin:8-jdk-jammy
+FROM eclipse-temurin:17-jdk-jammy
 MAINTAINER Apache BookKeeper <[email protected]>
 
 ENV BK_JOURNALDIR=/opt/bookkeeper/data/journal
@@ -36,8 +36,8 @@ RUN sed -i -e 
"s|http://archive\.ubuntu\.com/ubuntu/|${UBUNTU_MIRROR:-http://arc
     && echo "dash dash/sh boolean false" | debconf-set-selections \
     && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash \
     && JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java)))) \
-    && echo networkaddress.cache.ttl=1 >> 
$JAVA_HOME/jre/lib/security/java.security \
-    && echo networkaddress.cache.negative.ttl=1 >> 
$JAVA_HOME/jre/lib/security/java.security
+    && echo networkaddress.cache.ttl=1 >> 
$JAVA_HOME/conf/security/java.security \
+    && echo networkaddress.cache.negative.ttl=1 >> 
$JAVA_HOME/conf/security/java.security
 
 RUN mkdir /tarballs
 WORKDIR /tarballs
diff --git 
a/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh 
b/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh
index 666a5419a4..c9d28eb494 100755
--- a/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh
+++ b/tests/docker-images/all-released-versions-image/scripts/install-tarball.sh
@@ -22,6 +22,11 @@ set -e
 
 TARBALL=$1
 
+if [ ! -f "$TARBALL" ]; then
+  echo "tar file '$TARBALL' doesn't exist. exiting."
+  exit 0
+fi
+
 if [ -f $TARBALL.sha1 ]; then
     sha1sum --check $TARBALL.sha1 > /dev/null
 fi
@@ -40,6 +45,14 @@ VERSION=$(echo $TARBALL | sed -nE 
's!^bookkeeper-(dist-)?server-([^-]*(-SNAPSHOT
 tar -zxf $TARBALL
 mv bookkeeper-server-$VERSION /opt/bookkeeper/$VERSION
 
+VERSION_BASE=$(echo $VERSION | sed 's/-SNAPSHOT//')
+# if version isn't 4.18 or higher, use Java 8
+if [[ $(printf '%s\n' "4.18" "$VERSION_BASE" | sort -V | head -1) != "4.18" 
]]; then
+    
JAVA_ENV='environment=JAVA_HOME="/opt/java/openjdk-8",PATH="/opt/java/openjdk-8/bin:%(ENV_PATH)s"'
+else
+    JAVA_ENV=""
+fi
+
 cat > /etc/supervisord/conf.d/bookkeeper-$VERSION.conf <<EOF
 [program:bookkeeper-$VERSION]
 autostart=false
@@ -47,4 +60,5 @@ redirect_stderr=true
 stdout_logfile=/var/log/bookkeeper/stdout-$VERSION.log
 directory=/opt/bookkeeper/$VERSION
 command=/opt/bookkeeper/$VERSION/bin/bookkeeper bookie
-EOF
+$JAVA_ENV
+EOF
\ No newline at end of file
diff --git a/tests/docker-images/all-versions-image/Dockerfile 
b/tests/docker-images/all-versions-image/Dockerfile
index 8869ddfb6a..cff955245c 100644
--- a/tests/docker-images/all-versions-image/Dockerfile
+++ b/tests/docker-images/all-versions-image/Dockerfile
@@ -16,6 +16,11 @@
 # specific language governing permissions and limitations
 # under the License.
 #
+
+# openjdk-8 is used for running old bookkeeper version, 4.18+ will use Java 17
+FROM eclipse-temurin:8-jdk-jammy AS openjdk-8
+
+# Java 17 is part of the parent image
 FROM apachebookkeeper/bookkeeper-all-released-versions:latest
 MAINTAINER Apache BookKeeper <[email protected]>
 
@@ -25,6 +30,10 @@ RUN mkdir /tarballs
 WORKDIR /tarballs
 COPY ${BK_TARBALL} /tarballs/
 
+COPY --from=openjdk-8 /opt/java/openjdk /opt/java/openjdk-8
+RUN echo networkaddress.cache.ttl=1 >> 
/opt/java/openjdk-8/jre/lib/security/java.security \
+  && echo networkaddress.cache.negative.ttl=1 >> 
/opt/java/openjdk-8/jre/lib/security/java.security
+
 RUN /install-tarball.sh *.tar.gz && rm -rf /tarballs
 
 WORKDIR /
diff --git 
a/tests/docker-images/all-versions-image/scripts/install-all-tarballs.sh 
b/tests/docker-images/all-versions-image/scripts/install-all-tarballs.sh
deleted file mode 100644
index af9894ea99..0000000000
--- a/tests/docker-images/all-versions-image/scripts/install-all-tarballs.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/usr/bin/env bash
-#
-#/**
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements.  See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership.  The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License.  You may obtain a copy of the License at
-# *
-# *     http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-set -e
-
-BK_LOGDIR=/var/log/bookkeeper
-
-mkdir -p /etc/supervisord/conf.d
-cat > /etc/supervisord.conf <<EOF
-[supervisord]
-nodaemon=true
-logfile=/var/log/supervisord.log
-logfile_maxbytes=50MB
-logfile_backups=10
-loglevel=info
-pidfile=/var/run/supervisord.pid
-minfds=1024
-minprocs=200
-
-[unix_http_server]
-file=/var/run/supervisor/supervisor.sock
-
-[supervisorctl]
-serverurl=unix:///var/run/supervisor/supervisor.sock
-
-[rpcinterface:supervisor]
-supervisor.rpcinterface_factory = 
supervisor.rpcinterface:make_main_rpcinterface
-
-[include]
-files = /etc/supervisord/conf.d/*.conf
-EOF
-
-set -x
-
-gpg --import KEYS
-gpg --import KEYS.old
-
-mkdir -p /opt/bookkeeper
-mkdir -p $BK_LOGDIR
-
-for T in bookkeeper-{,dist-}server-*-bin.tar.gz; do
-    if [ -f $T.sha1 ]; then
-        sha1sum --check $T.sha1 > /dev/null
-    fi
-    if [ -f $T.sha512 ]; then
-        sha512sum --check $T.sha512 > /dev/null
-    fi
-    if [ -f $T.md5 ]; then
-        md5sum --check $T.md5 > /dev/null
-    fi
-    if [ -f $T.asc ]; then
-        gpg --verify $T.asc
-    fi
-
-    VERSION=$(echo $T | sed -nE 
's!^bookkeeper-(dist-)?server-([^-]*(-SNAPSHOT)?)-bin.tar.gz$!\2!p')
-
-    tar -zxf $T
-    mv bookkeeper-server-$VERSION /opt/bookkeeper/$VERSION
-
-    cat > /etc/supervisord/conf.d/bookkeeper-$VERSION.conf <<EOF
-[program:bookkeeper-$VERSION]
-autostart=false
-redirect_stderr=true
-stdout_logfile=$BK_LOGDIR/stdout-$VERSION.log
-directory=/opt/bookkeeper/$VERSION
-command=/opt/bookkeeper/$VERSION/bin/bookkeeper bookie
-EOF
-
-done
-
diff --git a/tests/integration-tests-base-groovy/pom.xml 
b/tests/integration-tests-base-groovy/pom.xml
index 1daa998f37..12b28232b7 100644
--- a/tests/integration-tests-base-groovy/pom.xml
+++ b/tests/integration-tests-base-groovy/pom.xml
@@ -32,6 +32,10 @@
   <properties>
     <groovy-eclipse-compiler.version>3.7.0</groovy-eclipse-compiler.version>
     <groovy-eclipse-batch.version>3.0.8-01</groovy-eclipse-batch.version>
+    <!-- org.codehaus.groovy:groovy-eclipse compiler doesn't support Java 17, 
use Java 11 -->
+    <maven.compiler.source>11</maven.compiler.source>
+    <maven.compiler.target>11</maven.compiler.target>
+    <maven.compiler.release>11</maven.compiler.release>
   </properties>
 
   <build>
diff --git 
a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java
 
b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java
index d77c3920ac..026568dc33 100644
--- 
a/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java
+++ 
b/tests/integration-tests-utils/src/main/java/org/apache/bookkeeper/tests/integration/utils/MavenClassLoader.java
@@ -110,10 +110,14 @@ public class MavenClassLoader implements AutoCloseable {
                 createExclusion("org.slf4j", "slf4j-log4j12"),
                 createExclusion("ch.qos.reload4j", "log4j"),
                 createExclusion("org.slf4j", "slf4j-reload4j"),
-                createExclusion("org.apache.logging.log4j", "*")
+                createExclusion("org.apache.logging.log4j", "*"),
+                createExclusion("org.apache.zookeeper", "zookeeper")
                 );
         List<MavenDependency> deps = Lists.newArrayList(
                 dependency);
+        // use newer zookeeper version in all cases
+        
deps.add(MavenDependencies.createDependency("org.apache.zookeeper:zookeeper:3.9.3",
+                ScopeType.COMPILE, false));
         if (slf4jVersion.isPresent()) {
             
deps.add(MavenDependencies.createDependency("org.slf4j:slf4j-simple:" + 
slf4jVersion.get(),
                     ScopeType.COMPILE, false));
diff --git a/tests/pom.xml b/tests/pom.xml
index 75128f83e8..96dd7e57dc 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -28,7 +28,7 @@
   <name>Apache BookKeeper :: Tests</name>
 
   <properties>
-    <groovy.version>3.0.20</groovy.version>
+    <groovy.version>3.0.25</groovy.version>
     <!-- must be compatible with arquillian-cube-docker -->
     
<arquillian-cube.docker-java.version>3.2.14</arquillian-cube.docker-java.version>
     <arquillian-cube.snakeyaml.version>1.19</arquillian-cube.snakeyaml.version>
diff --git a/tests/scripts/src/test/bash/bk_test_bin_common.sh 
b/tests/scripts/src/test/bash/bk_test_bin_common.sh
index d0056be584..785dde16e2 100644
--- a/tests/scripts/src/test/bash/bk_test_bin_common.sh
+++ b/tests/scripts/src/test/bash/bk_test_bin_common.sh
@@ -198,12 +198,7 @@ testBuildBookieJVMOpts() {
   TEST_LOG_DIR=${BK_TMPDIR}/logdir
   TEST_GC_LOG_FILENAME="test-gc.log"
   ACTUAL_JVM_OPTS=$(build_bookie_jvm_opts ${TEST_LOG_DIR} 
${TEST_GC_LOG_FILENAME})
-  USEJDK8=$(detect_jdk8)
-  if [ "$USING_JDK8" -ne "1" ]; then
-    EXPECTED_JVM_OPTS="-Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g 
${DEFAULT_BOOKIE_GC_OPTS} ${DEFAULT_BOOKIE_GC_LOGGING_OPTS}  
-Xlog:gc=info:file=${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}::filecount=5,filesize=64m"
-  else
-    EXPECTED_JVM_OPTS="-Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g 
${DEFAULT_BOOKIE_GC_OPTS} ${DEFAULT_BOOKIE_GC_LOGGING_OPTS}  
-Xloggc:${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}"
-  fi
+  EXPECTED_JVM_OPTS="-Xms1g -Xmx1g -XX:MaxDirectMemorySize=2g 
${DEFAULT_BOOKIE_GC_OPTS} ${DEFAULT_BOOKIE_GC_LOGGING_OPTS}  
-Xlog:gc=info:file=${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}::filecount=5,filesize=64m"
   assertEquals "JVM OPTS is not set correctly" "${EXPECTED_JVM_OPTS}" 
"${ACTUAL_JVM_OPTS}"
 }
 
@@ -213,12 +208,7 @@ testBuildCLIJVMOpts() {
   TEST_LOG_DIR=${BK_TMPDIR}/logdir
   TEST_GC_LOG_FILENAME="test-gc.log"
   ACTUAL_JVM_OPTS=$(build_cli_jvm_opts ${TEST_LOG_DIR} ${TEST_GC_LOG_FILENAME})
-  USEJDK8=$(detect_jdk8)
-  if [ "$USING_JDK8" -ne "1" ]; then
-    EXPECTED_JVM_OPTS="-Xms256M -Xmx512M ${DEFAULT_CLI_GC_OPTS} 
${DEFAULT_CLI_GC_LOGGING_OPTS} 
-Xlog:gc=info:file=${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}::filecount=5,filesize=64m"
-  else
-    EXPECTED_JVM_OPTS="-Xms256M -Xmx512M ${DEFAULT_CLI_GC_OPTS} 
${DEFAULT_CLI_GC_LOGGING_OPTS} -Xloggc:${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}"
-  fi
+  EXPECTED_JVM_OPTS="-Xms256M -Xmx512M ${DEFAULT_CLI_GC_OPTS} 
${DEFAULT_CLI_GC_LOGGING_OPTS} 
-Xlog:gc=info:file=${TEST_LOG_DIR}/${TEST_GC_LOG_FILENAME}::filecount=5,filesize=64m"
   assertEquals "JVM OPTS is not set correctly" "${EXPECTED_JVM_OPTS}" 
"${ACTUAL_JVM_OPTS}"
 }
 
@@ -226,12 +216,7 @@ testBuildNettyOpts() {
   source ${BK_BINDIR}/common.sh
 
   ACTUAL_NETTY_OPTS=$(build_netty_opts)
-  EXPECTED_NETTY_OPTS=""
-  if [ "$USING_JDK8" -ne "1" ]; then
-      EXPECTED_NETTY_OPTS="-Dio.netty.leakDetectionLevel=disabled 
-Dio.netty.tryReflectionSetAccessible=true --add-opens 
java.base/java.nio=ALL-UNNAMED --add-opens 
java.base/jdk.internal.misc=ALL-UNNAMED"
-  else
-      EXPECTED_NETTY_OPTS="-Dio.netty.leakDetectionLevel=disabled 
-Dio.netty.tryReflectionSetAccessible=true"
-  fi
+  EXPECTED_NETTY_OPTS="-Dio.netty.leakDetectionLevel=disabled 
-Dio.netty.tryReflectionSetAccessible=true --add-opens 
java.base/java.nio=ALL-UNNAMED --add-opens 
java.base/jdk.internal.misc=ALL-UNNAMED"
 
   assertEquals "Netty OPTS is not set correctly" "${EXPECTED_NETTY_OPTS}" 
"${ACTUAL_NETTY_OPTS}"
 }
@@ -240,14 +225,7 @@ testBuildBookieOpts() {
   source ${BK_BINDIR}/common.sh
 
   ACTUAL_OPTS=$(build_bookie_opts)
-  EXPECTED_OPTS="-Djava.net.preferIPv4Stack=true"
-
-  USEJDK8=$(detect_jdk8)
-  if [ "$USING_JDK8" -ne "1" ]; then
-    EXPECTED_OPTS="-Djava.net.preferIPv4Stack=true --add-opens 
java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util.zip=ALL-UNNAMED"
-  else
-    EXPECTED_OPTS="-Djava.net.preferIPv4Stack=true"
-  fi
+  EXPECTED_OPTS="-Djava.net.preferIPv4Stack=true --add-opens 
java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util.zip=ALL-UNNAMED"
 
   assertEquals "Bookie OPTS is not set correctly" "${EXPECTED_OPTS}" 
"${ACTUAL_OPTS}"
 }
diff --git 
a/tools/stream/src/main/java/org/apache/bookkeeper/stream/cli/commands/cluster/InitClusterCommand.java
 
b/tools/stream/src/main/java/org/apache/bookkeeper/stream/cli/commands/cluster/InitClusterCommand.java
index 438025aec0..5e944da61b 100644
--- 
a/tools/stream/src/main/java/org/apache/bookkeeper/stream/cli/commands/cluster/InitClusterCommand.java
+++ 
b/tools/stream/src/main/java/org/apache/bookkeeper/stream/cli/commands/cluster/InitClusterCommand.java
@@ -108,7 +108,7 @@ public class InitClusterCommand extends BKCommand<Flags> {
     }
 
     @Override
-    @SuppressFBWarnings("RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE")
+    @SuppressFBWarnings({"RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE", 
"DMI_DOH"})
     protected boolean apply(ServiceURI ignored,
                             CompositeConfiguration conf,
                             BKFlags globalFlags,


Reply via email to