Skip to content

Commit 195f44c

Browse files
piotrpdevk-wall
andauthored
build: deprecate Java 17. Upgrade to Java 21 in containers. (kroxylicious#3147)
* build: upgrade to jdk 21 in Dockerfiles Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: upgrade to jdk 21 Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * build: upgrade to jdk 21 in pom.xml files Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * build: remove explicit java version in IT tests pom.xml Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * fix: remove `@SuppressWarnings("resource")` using JDK 21 Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: update code comments referencing JDK 17 Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: add CHANGELOG.md entry Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: upgrade to Maven 3.8.8 Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * Revert "build: upgrade to jdk 21 in pom.xml files" This reverts commit 372b351. Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * Revert "build: remove explicit java version in IT tests pom.xml" This reverts commit 236d400. Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * Revert "fix: remove `@SuppressWarnings("resource")` using JDK 21" This reverts commit b3f292f. Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * Revert "docs: update code comments referencing JDK 17" This reverts commit f86a169. Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * Revert "docs: upgrade to jdk 21" This reverts commit 1ef5e70 Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: JDK 17 deprecation Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: update CHANGELOG.md Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * build: add Java 17 deprecation warning Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: adjust deprecation notice wording Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: log warning for Java <17 Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * Revert "docs: log warning for Java <17" This reverts commit 570e00d. Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * docs: log warning for deprecated and unsupported JREs Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * change wording in changelog Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * change startup warning wording Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * filter author persona targeted wording Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * remove un-needed changelog entry Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * adjust pom.xml maven message Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> * fix version if statement Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> --------- Signed-off-by: Piotr Płaczek <piotrpdev@gmail.com> Signed-off-by: Keith Wall <kwall@apache.org> Co-authored-by: Keith Wall <kwall@apache.org>
1 parent 71131c9 commit 195f44c

12 files changed

Lines changed: 64 additions & 22 deletions

File tree

.github/workflows/docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
uses: actions/setup-java@v5
4141
with:
4242
distribution: 'temurin'
43-
java-version: '17'
43+
java-version: '21'
4444

4545
- name: Determine Build Configuration
4646
id: build_configuration

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Format `<github issue/pr number>: <short description>`.
77

88
## SNAPSHOT
99

10+
* [#3147](https://github.com/kroxylicious/kroxylicious/pull/3129): Deprecate Java 17. Upgrade to Java 21 in containers.
1011
* [#3127](https://github.com/kroxylicious/kroxylicious/pull/3127): build(deps): bump kubernetes-client.version from 7.4.0 to 7.5.0
1112
* [#3112](https://github.com/kroxylicious/kroxylicious/pull/3112): cache topic name lookups per VirtualCluster
1213
* [#3129](https://github.com/kroxylicious/kroxylicious/pull/3129): build(deps): bump netty.version from 4.2.7.Final to 4.2.9.Final
@@ -15,6 +16,8 @@ Format `<github issue/pr number>: <short description>`.
1516

1617
### Changes, deprecations and removals
1718

19+
* Running Kroxylicious on Java 17 is deprecated. The minimum required Java version will be raised to 21 in a future release.
20+
* Containers have been upgraded to use Java 21.
1821
* The four argument forms of `RequestFilter#onRequest` and `ResponseFilter#onResponse` are deprecated and will be removed in a future release.
1922
Implement the five argument form, which includes the `apiVersion` instead.
2023

DEV_GUIDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ This document gives a detailed breakdown of the various build processes and opti
4949

5050
## Build Prerequisites
5151

52-
- [JDK](https://openjdk.org/projects/jdk/17/) (version 21 and above) - JDK
53-
- [`mvn`](https://maven.apache.org/index.html) (version 3.6.3 and above) - [Apache Maven®](https://maven.apache.org)
52+
- [JDK](https://openjdk.org/projects/jdk/21/) (version 21 and above) - JDK
53+
- [`mvn`](https://maven.apache.org/index.html) (version 3.8.8 and above) - [Apache Maven®](https://maven.apache.org)
5454
- [`docker`](https://docs.docker.com/install/) or [`podman`](https://podman.io/docs/installation) - Docker or Podman
5555

5656
> :warning: **If you are using Podman please see [these notes](#running-integration-tests-on-podman) below**
@@ -62,7 +62,7 @@ This document gives a detailed breakdown of the various build processes and opti
6262
JDK version 21 or newer, and [Apache Maven®](https://maven.apache.org) are required for building this project.
6363

6464
Kroxylicious targets language level 17, except for the `integrationtests` module
65-
which targets 21 to access some new language features.
65+
which targets 21 to access some new language features. At production runtime, Java 17 remains supported but is deprecated. Use Java 21 or later.
6666

6767
Build the project like this:
6868

@@ -299,15 +299,15 @@ While Kroxylicious is a java application we've had reports of issues running the
299299
Expect output similar to:
300300
```shell
301301
> java --version
302-
openjdk 19.0.2 2023-01-17
303-
OpenJDK Runtime Environment Temurin-19.0.2+7 (build 19.0.2+7)
304-
OpenJDK 64-Bit Server VM Temurin-19.0.2+7 (build 19.0.2+7, mixed mode, sharing)
302+
openjdk 21.0.8 2025-07-15 LTS
303+
OpenJDK Runtime Environment Temurin-21.0.8+9 (build 21.0.8+9-LTS)
304+
OpenJDK 64-Bit Server VM Temurin-21.0.8+9 (build 21.0.8+9-LTS, mixed mode, sharing
305305
```
306306
2. Update if needed: sample update command like:
307307
```shell
308308
sudo apt update
309309
sudo apt upgrade
310-
sudo apt install openjdk-18-jre-headless
310+
sudo apt install openjdk-21-jre-headless
311311
```
312312
4. Ensure GIT is available
313313
1. ```shell

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
55
#
66

7-
FROM registry.access.redhat.com/ubi9/openjdk-17:1.24-2.1767878246 AS builder
7+
FROM registry.access.redhat.com/ubi9/openjdk-21:1.24-2.1767878250 AS builder
88

99
ARG TARGETOS
1010
ARG TARGETARCH
@@ -42,7 +42,7 @@ RUN mvn -q -B clean package -Pdist -Dquick -DskipContainerImageBuild=true -Dskip
4242

4343
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1768783948
4444

45-
ARG JAVA_VERSION=17
45+
ARG JAVA_VERSION=21
4646
ARG KROXYLICIOUS_VERSION
4747
ARG CONTAINER_USER=kroxylicious
4848
ARG CONTAINER_USER_UID=185
@@ -58,7 +58,7 @@ RUN microdnf -y update \
5858
&& microdnf remove -y shadow-utils \
5959
&& microdnf clean all
6060

61-
ENV JAVA_HOME=/usr/lib/jvm/jre-17
61+
ENV JAVA_HOME=/usr/lib/jvm/jre-21
6262

6363
COPY --from=builder /opt/tini/bin/tini /usr/bin/tini
6464
COPY --from=builder /opt/kroxylicious/kroxylicious-app/target/kroxylicious-app-${KROXYLICIOUS_VERSION}-bin/kroxylicious-app-${KROXYLICIOUS_VERSION}/ /opt/kroxylicious/

Dockerfile.operator

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
55
#
66

7-
FROM registry.access.redhat.com/ubi9/openjdk-17:1.24-2.1767878246 AS builder
7+
FROM registry.access.redhat.com/ubi9/openjdk-21:1.24-2.1767878250 AS builder
88

99
ARG TARGETOS=linux
1010
ARG TARGETARCH
@@ -43,7 +43,7 @@ RUN mvn -q -B clean package -Pdist -Dquick -DskipContainerImageBuild=true -Dskip
4343

4444
FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1768783948
4545

46-
ARG JAVA_VERSION=17
46+
ARG JAVA_VERSION=21
4747
ARG KROXYLICIOUS_VERSION
4848
ARG CONTAINER_USER=kroxylicious
4949
ARG CONTAINER_USER_UID=185
@@ -59,7 +59,7 @@ RUN microdnf -y update \
5959
&& microdnf remove -y shadow-utils \
6060
&& microdnf clean all
6161

62-
ENV JAVA_HOME=/usr/lib/jvm/jre-17
62+
ENV JAVA_HOME=/usr/lib/jvm/jre-21
6363

6464
COPY --from=builder /opt/tini/bin/tini /usr/bin/tini
6565
COPY --from=builder /opt/kroxylicious/kroxylicious-operator/target/kroxylicious-operator-${KROXYLICIOUS_VERSION}-app/kroxylicious-operator-${KROXYLICIOUS_VERSION} /opt/kroxylicious-operator

PERFORMANCE.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ The tested scenarios are:
2222
* Kroxylicious + Kafka - envelope encryption with encrypted topic
2323
* Kroxylicious + Kafka - envelope encryption without encrypted topic
2424

25-
## Prerequisites
25+
## Prerequisites
2626

27-
- [JDK](https://openjdk.org/projects/jdk/17/) (version 17 and above) - JDK
28-
- [`mvn`](https://maven.apache.org/index.html) (version 3.5 and above) - Maven CLI
27+
- [JDK](https://openjdk.org/projects/jdk/21/) (version 21 and above) - JDK
28+
- At production runtime, Java 17 remains supported but is deprecated. Use Java 21 or later.
29+
- [`mvn`](https://maven.apache.org/index.html) (version 3.8.8 and above) - Maven CLI
2930
- [`docker`](https://docs.docker.com/install/) or [`podman`](https://podman.io/docs/installation) - Docker or Podman
3031
- [`jq`](https://jqlang.github.io/) 1.7 or higher
3132

kroxylicious-app/src/main/docker/proxy.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1768783948
88

99
ARG TARGETOS
1010
ARG TARGETARCH
11-
ARG JAVA_VERSION=17
11+
ARG JAVA_VERSION=21
1212
ARG KROXYLICIOUS_VERSION
1313
ARG CONTAINER_USER=kroxylicious
1414
ARG CONTAINER_USER_UID=185

kroxylicious-docs/docs/_modules/con-custom-filters.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[role="_abstract"]
1111
Custom filters can be written in the Java programming language.
12-
Kroxylicious supports Java 17.
12+
Kroxylicious supports Java 21.
1313
Knowledge of the {kafka-protocol}[Kafka protocol^] is generally required to write a protocol filter.
1414

1515
There is currently one class of Custom Filters users can implement:

kroxylicious-docs/docs/proxy-quick-start/index.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Get Kroxylicious, the snappy open source proxy for Apache Kafka®, up and runnin
1313

1414
Before you begin, ensure you have the following installed and configured.
1515

16-
* **Java 17+**
16+
* **Java 21+**
1717
+
18-
Kroxylicious requires a Java Runtime Environment (JRE) version 17 or higher. To check your version, run:
18+
Kroxylicious requires a Java Runtime Environment (JRE) version 21 or higher (JRE 17 remains supported for now but is deprecated). To check your version, run:
1919
+
2020
[source,bash]
2121
----

kroxylicious-operator/src/main/docker/operator.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7-1768783948
88

99
ARG TARGETOS=linux
1010
ARG TARGETARCH
11-
ARG JAVA_VERSION=17
11+
ARG JAVA_VERSION=21
1212
ARG KROXYLICIOUS_VERSION
1313
ARG CONTAINER_USER=kroxylicious
1414
ARG CONTAINER_USER_UID=185

0 commit comments

Comments
 (0)