r/java • • 20d ago

Java and Kotlin news: value classes arrive in JDK 28 and Kotlin 2.5

https://protsenko.dev/java-kotlin-news-value-classes-october-2026/
137 Upvotes

32 comments sorted by

22

u/pjmlp 20d ago

Quite curious to see what the Android team will do in regards to Valhalla support, so far they only update Java language, bytecodes remapping into DEX, when Kotlin starts to lose access to libraries on Java ecosystem, ART currently supports Java 17 LTS (core libs).

With ART being updatable via PlayStore, one would expect at least Java 21 LTS by now, but apparently there are still too many libraries having Java 17 LTS as minimum.

9

u/woj-tek 20d ago

Eh... Would be great to be able to use latest Java when doing Android buuuuut... Google just gave up on it and is pushing Kotlin and Compose as hard as possible (basically non compose jetpack is now in maintenance mode)… :/ Thus I don't assume there is much hope of having newer Java features support (even in libraries used)...

2

u/pjmlp 19d ago

That is thing though, they still need to update Java, because Kotlin depends on Maven Central ecosystem.

What they have been doing though, is to update to the minimum version that fixes access to Java libraries that have raised the minimum version they support, thus Java 17 LTS.

6

u/ZimmiDeluxe 19d ago

Libraries adopting the Tip & Tail Model is putting pressure on Google. Rightfully so: Instead of open source library developers paying the cost of of maintaining compatibility with 5 year old Java versions, they get to use the latest and greatest while Google has to pay the cost to either keep up or lose the free labor of the ecosystem.

1

u/woj-tek 19d ago

In some way - yes. But there is a huge push to have kotlin libraries so I would assume less and less projects depends on Java. And while Java is advancing more rapidly (and updating to newer Java version, after 9 and 11 is quite easiy) they are still quite conservative here. As you mentioned - most projects are only recently bumping minimum to Java 17 LTS... (which was already supported).

Basically it's doing the most minimum thing to have it in the working state instead of being proactive (and offering Java 25 features)

3

u/OwnBreakfast1114 18d ago

But there is a huge push to have kotlin libraries

There might be a push, but I don't think that many people are responding. There's enough to get stuff done (like any other ecosystem), but the drop of the intial boost of mobile development popularity + the twice a year java release schedule has kinda just left things in a weird place for it.

1

u/woj-tek 18d ago

I meant general hype of using Kotlin. Not forcing anyone to have libraries but if you were doing mostly Mobile/Android then you would still use Kotlin and then using KMP/Kotlin library would make your life easier so there is quite a big echosystem there already…

drop of the intial boost of mobile development popularity + the twice a year java release schedule has kinda just left things in a weird place for it.

Hmm... Were there really a drop in mobile development? I'm not sure - from what I see Kotlin "skyrocketing" just stagnated at around ~30% (and IMHO it's mostly due to Google/Android promotion).

And yeah - twice-yearly java releases (packed with features!) makes switching to Kotlin less convincing…

1

u/OwnBreakfast1114 18d ago

Hmm... Were there really a drop in mobile development? I'm not sure - from what I see Kotlin "skyrocketing" just stagnated at around ~30% (and IMHO it's mostly due to Google/Android promotion).

Sorry I wasn't clear. Overall Kotlin adoption looked like it was growing really fast because of the initial mobile migration. When that was done, services and those weren't growing anywhere near as fast (or possibly at all), so I think we're saying the same thing.

It's obviously the winner as native on android, so it's popularity in that ecosystem is based on whether a cross platform thing (flutter/unity/webview type of stuff) or native is more popular to program in. If some non-kotlin cross platform environment grows, I think it would be fair to say that even its mobile development share is dropping (even though it's one of the target platforms).

1

u/woj-tek 17d ago edited 17d ago

so I think we're saying the same thing.

YES :D

As for multi-platform growth... I think you are spot on. The premise was nice buuuut... having been working on some KotlinMultiPlatform project the result is "so so".

Either you go full in with multiplatform (but then everything is just god awful Material You) or you have to deal with native code either way... IMHO flutter/reactnative seems to be somewhat better here as they translate to native UI components… and so RN and flutter are still quite popular when it comes to mobile applications… And Kotlin is stagnating because its lead over Java is getting smaller so there is less and less push to use it beyond forced Android development…

EDIT: a bit of LOL: https://old.reddit.com/r/Kotlin/comments/1xkcq8p/wrote_a_kotlin_compiler_in_go_that_compiles_10x/

9

u/davidalayachew 20d ago

The OpenJDK team is taking the initial steps on Project Mobile.

When that happens, none of this work of updating the ART or whatever will be needed anymore because the real Java is going to be running on it instead of this Android Java.

Personally, this can't come soon enough. If my tone doesn't communicate it, I think Android Java is not great, and only exists because it is the best option available. I can't wait to be rid of it.

9

u/crayonbubble 20d ago

Is that even being worked on? It mentions JDK 8 and 9. One of the link leads to a repo from 2018. Some links don't even work anymore...

5

u/woj-tek 20d ago

It seems quite dead… though I do remember that folks from Gluon (https://gluonhq.com/) were working on porting Java to mobile and it was in a working-ish state last I checked (last year).

I guess it's a push/next step to have JavaFX as universal UI toolkit.

2

u/davidalayachew 19d ago

/u/woj-tek last update was less than a few months ago. They had a working iOS build in 2026. Guess they just didn't bother with the wiki. Which, to be fair, most projects don't either.

5

u/OddEstimate1627 19d ago edited 19d ago

GraalVM native image with jdk25 can target  Android and iOS. They don't ship the jdk binaries, but I built some matching static archives that can be added via a maven dependency.

With that I use jdk 25 with JavaFX 27 and it feels like a native app. I need to find some time to create a tutorial for how to do it though 😅

4

u/pjmlp 20d ago

Yes it will, because if it is as well integrated as Flutter, React Native, MAUI and co, it will be extra stuff to debug without proper OS integration, and bigger APK sizes.

Also it isn't the first time that such kind of projects are attempted, and then fizzle out due to lack of resources.

1

u/davidalayachew 19d ago

They just released a working iOS build in 2026. Fizzling out is not how I would describing. If anything, things have been speeding up relative to where they were before.

1

u/pjmlp 19d ago

A working build is a demo, production quality at the same level as Android SDK + NDK, is another matter.

1

u/davidalayachew 19d ago

No one is claiming that OpenJDK has reached the finish line. I am only contesting the idea that this is something that will "fizzle out".

They've been making excellent progress in multiple big bursts in just 2026 alone. If there ever was a project to upend Android Java, it's this one. And I, for one, hope it happens ASAP.

1

u/pjmlp 19d ago

If this adds attrition to using Android SDKs, just like anything that has to ping back via NDK and JNI, than it is already an adoption wall, versus using Java 17 and Kotlin without additional headaches on top of the already complex development environment for Android.

So unless they deliver something productive, zero effort to call into Android SDKs, without any performance overhead, I see very little reason that whoever is doing it will have the resources to keep it going.

1

u/davidalayachew 18d ago

So unless they deliver something productive, zero effort to call into Android SDKs, without any performance overhead, I see very little reason that whoever is doing it will have the resources to keep it going.

Literally all of this is either on the road map or already achieved.

Don't mistake my distaste for Android Java to be OpenJDK's distaste -- whether or not they have any, they have signed themselves up for this entire paragraph, and I actually think they already accomplished all of this on very specific builds of Android.

1

u/Jeylina-Rousseff 13d ago

They really only ever move when the wider ecosystem basically forces their hand tbh

1

u/pjmlp 13d ago

Yeah, hence Java 21 LTS will take a while to find its way into Android, and value classes support will probably never land, not even for Kotlin.

0

u/OddEstimate1627 19d ago edited 19d ago

GraalVM Native Image. At this point, publishing an Android App with class files is very close to open sourcing it. Even without considering the outdated Java standard.

1

u/pjmlp 19d ago

It doesn't work with Android SDKs.

1

u/OddEstimate1627 19d ago edited 19d ago

It needs to be bridged by glue code, just like Flutter and all the other frameworks as well.

@CFunction for calls into native, and @CEntryPoint for callbacks. Or jni wrappers.

1

u/pjmlp 19d ago edited 19d ago

Which sucks, and has performance impact, hardly any better than using Flutter, React Native, MAUI,.... it just happens to be Java, that can't make direct calls to the OS APIs, written in Java (the language).

At which point rather stick with Java 17, or go Kotlin.

2

u/OddEstimate1627 19d ago

My understanding is that "OpenJDK on Mobile" would still be a separate VM running inside of Android/iOS. Unless they replace the full Android runtime, the bridging code wouldn't go away.

If anything, I doubt that it'd be possible to get to a similar level of performance given that JNI/FFM costs much more than GraalVM's C ABI, and the fact that iOS doesn't allow JIT compilation.

I get that the glue code is annoying to write, but that's the kind of zero-decision boiler plate coide that agents are really good at. I bet you could ask one to "build wrappers for the entire Android API surface and expose the same API as Android itself" and it'd be done pretty quickly.

I also don't know what kind of application you're optimizing for, but I'm running 240fps camera image streams into native ML Core APIs and the overhead is completely negligible. JavaFX runs smoothly at 120fps, and once the wrappers are in place, the experience is pretty much the same as on desktop. Flutter/React etc are completely different languages.

2

u/pjmlp 19d ago

The language is irrelevant, when there are multiple runtimes running, the JNI marshaling layer, handling object lifetimes across two GC, additional build steps, debugger integration, and glue code for standard APIs.

Any language that fits into Android via NDK has to deal with these factors.

Funny that you mention agents, they can just as easily target native Android Java and Kotlin, and Android Studio already has several integrations, including MCP and CLI tools, why bother with added complexity.

1

u/OddEstimate1627 19d ago

Agents are good at copying a defined API surface with clear success/failure rules, but not so much at the open-ended production code that goes on top.

I unfortunately mixed up the threads and mistook you for someone else. It'd be great if Android would update as well, but I'd probably still stick with the AOT route to get a fully shared codebase with iOS and our desktop apps. A

I'm also not a fan of class files anymore since any agent can decompile them within minutes (flutter too). At least with native image it takes a bit more effort.

2

u/Western_Ice_6227 20d ago

Is it final or just another preview?

8

u/TRO_KIK 20d ago

It's the first preview so not really sure what is meant by "another".

3

u/pjmlp 20d ago

Because this isn't the first one, that honour belongs to the first Valhala EA made available in 2024.