Java compiler and runtime version upgrade

Can we get an upgrade to openjdk 25.

Hey @base58ed, absolutely! We’ll start working on the upgrade and keep you posted once it’s ready.

Thank you for a prompt response. Please keep the –enable-preview switch for extra fun.

1 Like

@base58ed I’ve updated the Java version to 25 for the DNS server challenge.

You’ll also need to upgrade the buildpack version in your repo to match.

Let me know if you run into any issues!

Thanks @andy1li. I have two follow-ups:

  1. I tried preview features (for example switch pattern on primitive types) but got an exception:
    [your_program] Exception in thread “main” java.lang.UnsupportedClassVersionError: Preview features are not enabled for DNSServer (class file version 69.65535). Try running with ‘–enable-preview’
    I think with the build pack you have to enable the preview (--enable-preview) as well. Can you do that please?

  2. Can you do the same thing for all other challenges or would I have to create separate tickets for each challenge?

@base58ed You’ll also need to add the flag in your .codecrafters/run.sh file:

Yes, all challenges support Java 25 now.

1 Like

Fantastic. Thank you so much.

1 Like