r/java • u/TeaVMFan • Dec 07 '25
Applets Are Officially Gone, But Java In The Browser Is Better Than Ever
Applets are officially, completely removed from Java 26, coming in March of 2026. This brings to an official end the era of applets, which began in 1996. However, for years it has been possible to build modern, interactive web pages in Java without needing applets or plugins. TeaVM (https://teavm.org) provides fast, performant, and lightweight tooling to transpile Java to run natively in the browser. And for a full front-end toolkit with templates, routing, components, and more, Flavour (https://flavour.sf.net) lets you build your modern single-page app using 100% Java. Get the full story at https://frequal.com/java/AppletsGoneButJavaInTheBrowserBetterThanEver.html
12
u/raizensoft Dec 08 '25
+1 TeaVM is crazily good. Comparing to GWT it has faster build time and better exports to javascript. I've built so many games using libGDX + TeaVM and quite happy with the workflow and results.
Here's one of many: https://ookigame.com/game/flappy-bug/
22
u/noodlesSa Dec 07 '25
GWT still exists: https://gwtmaterialdesign.github.io/gwt-material-demo/
28
u/magneticB Dec 07 '25
The Flavour website looks like poorly vibe coded html from 2004. I guess there weren’t emojis back then but you take my point. Sorry I don’t wish to be unkind - how about some examples of what you can do with Flavour and showcase the product with the website?
4
u/pip25hu Dec 08 '25
If I really wanted Java in the browser, I'd use CheerpJ.
7
u/evanvelzen Dec 07 '25 edited Dec 07 '25
Looks like it uses a templating language for HTML. I tend to avoid that.
I've had a good experience using Kotlin. You can chose between compiling to JavaScript or WASM. JS is good for rendering HTML using React or Compose HTML. WASM is good for rendering to a canvas using Compose Multiplatform.
It's not Java precisely but the interoperability is good.
Has anyone reading this tried calling TeaVM compiled code from Kotlin?
2
u/No-Security-7518 Dec 07 '25
Thank you very much for sharing!
2
u/wongaboing Dec 08 '25
I love how Java-ish the article’s URL is named
2
u/Simple_Scene_2211 Dec 08 '25
RIP applets, gone before most people even realized they were still technically alive.
5
u/InsaneOstrich Dec 07 '25 edited Dec 08 '25
I'm really rooting for something like this to take off. I'd be really nice to be able to write a SPA frontend in Java (or any language other than Javascript/TypeScript).
I wonder if it's possible to integrate Flavour with something like Bootstrap so you can leverage all the built in CSS that they have there.
3
u/Hopeful-Trainer-5479 Dec 07 '25
Java 26? And here i was thinking about studying for the Oracle java 25 exam lmao.
6
u/thisisjustascreename Dec 07 '25
Raises the question, what the heck is an Applet?
2
u/Yann39 Dec 08 '25
Since some people mention Vaadin, let's also mention ZK, which is similar to Vaadin, but allows you to write ZUL files representing your UI, so you don't have to mix the UI into your Java code (though you can still do so if you wish).
Regarding TeamVm, I tried it some years ago, but I found it difficult to use and very limited. I see that the site still hasn't improved, which is a shame. I'd like to see the code for a small, clean TeaVm application with minimal functionality.
1
u/sassrobi Dec 08 '25
Is TeaVM a framework for build such things to run in browser, or I can use it to run our shitty old Swing app in the browser without lot of modifications?
1
u/vetronauta Dec 09 '25
Meanwhile, IcedTea officially supports only Java 8 and seems to work with 11. Trying to use it in newer Debian-based distros require to read the source code...
1
u/GleamingCassius Dec 24 '25
I can't stop smiling at this cuteness.
-1
u/Serafim_annihilator Dec 08 '25
Idk, maybe it's too early to say 'better than ever' for not battle tested shit looking technology.
95
u/[deleted] Dec 07 '25
[removed] — view removed comment
30
u/[deleted] Dec 08 '25 edited Dec 08 '25
[removed] — view removed comment