Skip to content

Switch to Java 21 build#206

Closed
pavelhoral wants to merge 1 commit intoWrenSecurity:mainfrom
pavelhoral:feat-java21
Closed

Switch to Java 21 build#206
pavelhoral wants to merge 1 commit intoWrenSecurity:mainfrom
pavelhoral:feat-java21

Conversation

@pavelhoral
Copy link
Copy Markdown
Member

This adds build time compatibility with JDK 21. The old build time compatibility has been dropped. Targetting lower JDK versions is still possible.

This adds build time compatibility with JDK 21. The old build time compatibility
has been dropped. Targetting lower JDK versions is still possible.
private static final int JAVA_VERSION = Runtime.version().feature();

public static List<DistributionPoint> getDistributionPoints(CRLDistributionPointsExtension extension) throws Exception {
if (JAVA_VERSION < 20) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This approach will not suffice. The new X509 implementation has been backported to Java 17 releases as well. We will need to go the "full reflection" path.

Copy link
Copy Markdown
Member Author

@pavelhoral pavelhoral Jul 24, 2025

Choose a reason for hiding this comment

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

Was not able to find any mention of this being changed / backported. Strange that I am getting linking error with Java 17 - https://github.com/WrenSecurity/wrenam/actions/runs/16508743719/job/46685928744

The difference in JVM is:

  • Java_Temurin-Hotspot_jdk/17.0.15-6/x64 - successful build
  • Java_Temurin-Hotspot_jdk/17.0.16-8/x64 - failed build

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nevermind, it is there https://bugs.openjdk.org/browse/JDK-8296072. Even backported to Oracle's Java 11.

Image

pavelhoral added a commit to pavelhoral/wrenam that referenced this pull request Jul 25, 2025
New JDK builds contain breaking changes in their internal API that we depend
on. This fixes those incompatibilities which enables Java 21 as a side effect.

Ref https://bugs.openjdk.org/browse/JDK-8296072
@pavelhoral
Copy link
Copy Markdown
Member Author

This has been replaced by #210.

@pavelhoral pavelhoral closed this Jul 25, 2025
karelmaxa added a commit that referenced this pull request Jul 28, 2025
Fix X509 incompatibility with newer JDKs (#206)
karelmaxa pushed a commit to karelmaxa/wrenam that referenced this pull request Jul 28, 2025
New JDK builds contain breaking changes in their internal API that we depend
on. This fixes those incompatibilities which enables Java 21 as a side effect.

Ref https://bugs.openjdk.org/browse/JDK-8296072
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant