Skip to content

Commit 3f14eb1

Browse files
authored
Update Strimzi to Java 21 (#12291)
Signed-off-by: Jakub Scholz <www@scholzj.com>
1 parent 96288c4 commit 3f14eb1

File tree

14 files changed

+30
-37
lines changed

14 files changed

+30
-37
lines changed

.azure/templates/jobs/build/build_strimzi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ jobs:
44
# Strategy for the job
55
strategy:
66
matrix:
7-
'build_strimzi_java-17':
8-
jdk_version: '17'
7+
'build_strimzi_java-21':
8+
jdk_version: '21'
99
main_build: 'true'
1010
# Set timeout for jobs
1111
timeoutInMinutes: 60

.azure/templates/jobs/build/deploy_strimzi_java.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ jobs:
44
# Strategy for the job
55
strategy:
66
matrix:
7-
'deploy_strimzi_java-17':
8-
jdk_version: '17'
7+
'deploy_strimzi_java-21':
8+
jdk_version: '21'
99
main_build: 'true'
1010
# Set timeout for jobs
1111
timeoutInMinutes: 60

.azure/templates/jobs/build/test_strimzi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ jobs:
44
# Strategy for the job
55
strategy:
66
matrix:
7-
'test_strimzi_java-17':
8-
jdk_version: '17'
7+
'test_strimzi_java-21':
8+
jdk_version: '21'
99
main_build: 'true'
1010
# Set timeout for jobs
1111
timeoutInMinutes: 90

.azure/templates/steps/prerequisites/install_java.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Step to configure JAVA on the agent
22
parameters:
33
- name: JDK_VERSION
4-
default: '17'
4+
default: '21'
55
steps:
66
- task: JavaToolInstaller@0
77
inputs:

.azure/templates/steps/system_test_general.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
${{ parameters.name }}:
25-
jdk_version: '17'
25+
jdk_version: '21'
2626
# Base system
2727
pool:
2828
vmImage: 'Ubuntu-22.04'

.github/actions/dependencies/setup-java/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
javaVersion:
1010
description: "Java version to be installed"
1111
required: false
12-
default: "17"
12+
default: "21"
1313
javaDistro:
1414
description: "Java distribution to be installed"
1515
required: false

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Install yq
4949
uses: ./.github/actions/dependencies/install-yq
5050

51-
# Setup OpenJDK 17
51+
# Setup OpenJDK 21
5252
- name: Setup Java and Maven
5353
uses: ./.github/actions/dependencies/setup-java
5454

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
## 0.50.0
44

5-
* Nothing here yet, but we will surely develop something new pretty soon 😉
5+
* Use Java 21 as the runtime and language level
66

77
### Major changes, deprecations, and removals
88

9+
* Strimzi Operators are now using Java 21 as the runtime and language level.
10+
The only exceptions are the `api`, `test`, `crd-annotations`, and `crd-generator` modules which use Java 11 as the language level for compatibility with older java versions.
11+
These modules will remain using the Java 11 language level up to and including Strimzi 0.51.
12+
They will move to Java 21 language level in Strimzi 1.0.0.
13+
If you use one of these modules as a dependency in your Java project, you will need to upgrade to Java 21 as well.
914
* `connector.plugin.version` option is now forbidden in `KafkaConnect` CR in `.spec.config` and in `KafkaMirrorMaker2` CR in `.spec.mirrors[].sourceConnector.config` and `.spec.mirrors[].checkpointConnector.config`. Please use the dedicated `version` field instead.
1015

1116
## 0.49.1

development-docs/DEV_GUIDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ run `brew install bash` to install a compatible version of `bash`. If you wish t
6666
updated bash run `sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells'` and `chsh -s /usr/local/bin/bash`
6767

6868
The `mvn` tool might install the latest version of OpenJDK during the brew install. For builds on macOS to succeed,
69-
OpenJDK version 17 needs to be installed. This can be done by running `brew install openjdk@17`. For maven to read the
69+
OpenJDK version 21 needs to be installed. This can be done by running `brew install openjdk@21`. For maven to read the
7070
new Java version, you will need to edit the `~/.mavenrc` file and paste the following
71-
line `export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-17.jdk/Contents/Home`.
71+
line `export JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-21.jdk/Contents/Home`.
7272

7373
You may come across an issue of linking from the above step. To solve this run this command:
74-
`sudo ln -sfn /usr/local/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk`.
74+
`sudo ln -sfn /usr/local/opt/openjdk@21/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk`.
7575
If this throws an error that it cannot find the file or directory, navigate into `/Library/Java/` (or however deep you
76-
can) and create a new folder named `JavaVirtualMachines` followed by creating a file named `openjdk-17.jdk`. The folder
77-
structure after everything is said and done should look like `/Library/Java/JavaVirtualMachines/openjdk-17.jdk`. After
76+
can) and create a new folder named `JavaVirtualMachines` followed by creating a file named `openjdk-21.jdk`. The folder
77+
structure after everything is said and done should look like `/Library/Java/JavaVirtualMachines/openjdk-21.jdk`. After
7878
doing that run the command at the beginning again and this should link the file and allow you to use maven with OpenJDK
79-
version 17.
79+
version 21.
8080

8181
When running the tests, you may encounter `OpenSSL` related errors for parts that you may not have even worked on, in
8282
which case you need to make sure you are using `OpenSSL` and not LibreSSL which comes by default with macOS.
@@ -246,7 +246,7 @@ Commonly used Make targets:
246246
247247
### Java versions
248248
249-
Strimzi currently developed and tested with Java 17.
249+
Strimzi currently developed and tested with Java 21.
250250
251251
### Building Docker images
252252

docker-images/base/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
22

33
LABEL org.opencontainers.image.source='https://github.com/strimzi/strimzi-kafka-operator'
44

5-
ARG JAVA_VERSION=17
5+
ARG JAVA_VERSION=21
66
ARG TARGETOS
77
ARG TARGETARCH
88
ARG strimzi_version
@@ -21,7 +21,7 @@ RUN microdnf update -y \
2121
&& microdnf reinstall -y tzdata \
2222
&& microdnf clean all -y
2323

24-
ENV JAVA_HOME=/usr/lib/jvm/jre-17
24+
ENV JAVA_HOME=/usr/lib/jvm/jre-${JAVA_VERSION}
2525

2626
#####
2727
# Add Tini

0 commit comments

Comments
 (0)