# Java compiler and runtime version upgrade

**URL:** <https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429>\
**Category:** Feature Requests\
**Created:** [October 23, 2025, 2:48pm UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429 "2025-10-23T14:48:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![base58ed](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/base58ed/32/17761_2.png) [@base58ed](https://forum.codecrafters.io/u/base58ed)\
**Post date:** [October 23, 2025, 2:48pm UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/1 "2025-10-23T14:48:23Z")

</div>

Can we get an upgrade to openjdk 25.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [October 23, 2025, 2:56pm UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/4 "2025-10-23T14:56:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![base58ed](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/base58ed/32/17761_2.png) [@base58ed](https://forum.codecrafters.io/u/base58ed)\
**Post date:** [October 23, 2025, 3:18pm UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/5 "2025-10-23T15:18:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [October 27, 2025, 2:47am UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/6 "2025-10-27T02:47:49Z")

</div>

@base58ed I’ve [updated the Java version to 25](https://github.com/codecrafters-io/build-your-own-dns-server/pull/95/files) for the DNS server challenge.

You’ll also need to [upgrade the buildpack version](https://forum.codecrafters.io/t/new-feature-update-language-version/15245) in your repo to match.

Let me know if you run into any issues!

---

<div class="post-metadata">

**Author:** ![base58ed](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/base58ed/32/17761_2.png) [@base58ed](https://forum.codecrafters.io/u/base58ed)\
**Post date:** [October 27, 2025, 7:39am UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/8 "2025-10-27T07:39:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [October 27, 2025, 9:09pm UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/10 "2025-10-27T21:09:12Z")

</div>

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

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/6/6/668ca411290e0c16360b817d4387f78710f4b2f7.png)

Yes, all challenges [support Java 25](https://forum.codecrafters.io/t/java-25-is-now-available/15446) now.

---

<div class="post-metadata">

**Author:** ![base58ed](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/base58ed/32/17761_2.png) [@base58ed](https://forum.codecrafters.io/u/base58ed)\
**Post date:** [October 28, 2025, 8:44am UTC](https://forum.codecrafters.io/t/java-compiler-and-runtime-version-upgrade/15429/12 "2025-10-28T08:44:09Z")

</div>

Fantastic. Thank you so much.
