NokiaTube | New address | Mode Desktop | On high quality
Skip to content

Remove OpenJDK 17 support on server side - #55610

Draft
stianst wants to merge 1 commit into
keycloak:mainfrom
stianst:remove-openjdk-17-support
Draft

stianst wants to merge 1 commit into
keycloak:mainfrom
stianst:remove-openjdk-17-support

Conversation

@stianst

@stianst stianst commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Closes #52369

Signed-off-by: stianst [email protected]

@stianst
stianst requested review from a team as code owners November 27, 2026 09:21
Copilot AI balanced review requested due to automatic review settings November 27, 2026 09:21
@stianst stianst added this to the 27.0 Development Milestone milestone Nov 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The inherited Java 21 compiler target breaks Java 17 compatibility for keycloak-client-registration-api, causing Java 17 consumers to fail with UnsupportedClassVersionError.

1 open issue
What changed in this PR

This PR raises Keycloak server’s minimum Java version to OpenJDK 21, addressing #52369, and aligns build settings, CI, and documentation.

Changes:

  • Sets the parent compiler default to Java 21 and removes module-level Java 17 overrides.
  • Raises the Jackson 3 admin client’s compiler release to Java 21.
  • Removes Java 17 from the affected CI matrix and documents the new server requirement.
File Description
rest/​admin-v2/​services/​pom.xml Inherits compiler and encoding settings from the parent.
pom.xml Defines Java 21 as the default server compiler level.
misc/​vuln-to-issues/​pom.xml Removes local compiler and encoding overrides.
misc/​theme-verifier/​pom.xml Removes local compiler and encoding overrides.
misc/​db-compatibility-verifier/​pom.xml Removes local compiler and encoding overrides.
integration/​admin-client-jackson3/​pom.xml Raises the compiler release to Java 21.
docs/​guides/​server/​supported-configurations.adoc Removes OpenJDK 17 from supported server runtimes.
docs/​documentation/​upgrading/​topics/​changes/​changes-27_0_0.adoc Adds the Java minimum-version migration notice.
docs/​building.md Updates build prerequisites to JDK 21 or 25.
.github/​workflows/​ci.yml Removes Java 17 from the affected test matrix.

Review effort: Balanced

Comment thread pom.xml Resolved

@vmuzikar vmuzikar left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more references to Java 17:

I found some references in the comments but these imply some refactoring is required so that's out of scope here, so stating it here JFTR:

@stianst
stianst force-pushed the remove-openjdk-17-support branch from fbf2edd to 61da7cf Compare November 27, 2026 11:30
@stianst
stianst requested a review from vmuzikar November 27, 2026 11:40
Comment on lines 276 to +279
* cacerts uses "changeit" as a conventional default password, and may be JKS on older JDKs.
* When isImplicitJreTruststore is true, password and provider are always null.
*/
private static KeyStore loadDefaultTruststore(String path, String type, String password, String provider, boolean isImplicitJreTruststore) {
private static KeyStore loadDefaultTruststore(String path, String type, String password, String provider) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the isImplicitJreTruststore parameter, the "changeit" fallback, and the JKS/"older JDKs" reference were all removed in this PR. Might worth to update to match the new signature, e.g. just "Load a truststore from the given path."

Comment thread rest/admin-v2/api/pom.xml
Comment on lines +16 to +18
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This is only cosmetic, and not a dealbreaker to merge this PR, so use it if you think it makes sense.

The only scenario where the comment below makes sense is if someone tries to use keycloak-admin-v2-api as a dependency in a project running on Java 8 or Java 11 outside Keycloak.

They'd see that the artifact warning Java 8 compatibility, add it to their project, and then get NoClassDefFoundError at runtime when the JVM tries to load the Jakarta EE 10 classes.

If that's acceptable, you don't need to read the text below :)

This is changing the compiler target from Java 11 to Java 8. The module depends on Jakarta EE 10 APIs (jakarta.ws.rs-api, jakarta.validation-api) which require Java 11+ at runtime, so anyone on Java 8 would hit NoClassDefFoundError on the Jakarta classes regardless of the compile target. The ListOptions.java and test changes (Set.of → Collections.emptySet, etc.) were unnecessary since those are Java 9+ features that worked fine at Java 11.

Two alternatives:

A) Remove the explicit compiler override entirely and inherit ${java.server.minimum.version} (21) from the root pom. This module lives under rest/ and is consumed only by server-side modules (quarkus/runtime, operator, rest/admin-v2/services), so treating it as server code seems natural. Revert the ListOptions.java and test changes.

B) Restore <maven.compiler.release>11</maven.compiler.release> explicitly, matching the actual minimum imposed by the Jakarta EE 10 dependencies. Same result — revert the code changes.

Either way the ListOptions.java and test changes can be dropped since they were only needed to satisfy the Java 8 target.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only scenario where the comment below makes sense is if someone tries to use keycloak-admin-v2-api as a dependency in a project running on Java 8 or Java 11 outside Keycloak.

That's a realistic scenario, it might be used with the Java Admin Client that supports Java as old as 8.

Comment on lines +7 to +10
=== OpenJDK 17 support removed

Keycloak server no longer supports running on OpenJDK 17, and the minimum supported version is now OpenJDK 21.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: the upgrading guide could help users assess impact with a few lines. But if you would like to keep things concise, that's not a problem. Something like:

=== OpenJDK 17 support removed

Keycloak server no longer supports running on OpenJDK 17, and the minimum supported version is now OpenJDK 21.
The official container image already uses OpenJDK 21 and is not affected by this change.
Client libraries (`keycloak-admin-client`, `keycloak-authz-client`) continue to support Java 8.
FIPS 140-2 deployments no longer need the `kc.java.security` file or the manual `XMLDSig` provider configuration that was required with older OpenJDK 17 versions.

@vmuzikar vmuzikar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some more comments. On top of that, there are a few more remaining issues.

== Other restrictions

To have SAML working, make sure that a `XMLDSig` security provider is available in your security providers.
To have Kerberos working, make sure that a `SunJGSS` security provider is available. In FIPS enabled RHEL 9 in OpenJDK 21, the `XMLDSig` security provider may be already enabled

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XMLDSig still needs to be explicitly enabled on FIPS. We need to adjust the docs.

// BCFIPS require "SecureRandom.getInstanceStrong" to be available. But it may not be available on RHEL 8 on OpenJDK 17 due the https://bugzilla.redhat.com/show_bug.cgi?id=2155060
private void checkSecureRandom(Runnable insertBcFipsProvider) {
try {
SecureRandom sr = SecureRandom.getInstanceStrong();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI claims SecureRandom.getInstanceStrong() is not enabled in true FIPS environment. That our CI misses it because the the kernel is not switched to FIPS, hence JDK is not switched to true FIPS mode either.

I think we might need some help from @mposolda on this.

Alternatively we could just revert this change to unblock Java 17 deprecation and tackle this clean up as a follow-up. That would be my preferred approach.

<modelVersion>4.0.0</modelVersion>

<properties>
<!-- this property prevents the warning "WARN FilenoUtil: Native subprocess control requires open access" when using JRuby for the unit tests on JDK17 -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is still needed in the end even on later JDKs. Sorry I was not clear in my previous review that here only we just need to update the comment.

* When isImplicitJreTruststore is true, password and provider are always null.
*/
private static KeyStore loadDefaultTruststore(String path, String type, String password, String provider, boolean isImplicitJreTruststore) {
private static KeyStore loadDefaultTruststore(String path, String type, String password, String provider) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually need this wrapper any more...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop support for OpenJDK 17 on the server side

4 participants