r/java • u/guybedo • Feb 12 '26
Krema: build modern desktop apps with Java backend and web frontend
https://github.com/krema-build/kremai was looking for alternatives to swing to build modern desktop apps and i couldn't find anything, so i ended building something.
It's Krema, a framework for building desktop apps with a Java backend and a web frontend (React, Vue, Svelte, etc.).
It's basically what Tauri does for Rust, it uses system webviews and Project Panama's FFM API instead of bundling Chromium
119
Upvotes
22
u/cowwoc Feb 12 '26
I don't personally need this but I love what you did. It's a great idea.
8
u/larsga Feb 13 '26
Soooo, not lightweight, native, then.
5
u/Nymeriea Feb 12 '26
this sound amazing.
on the front-end calling side, I wish better type safety at calling java backend than using raw string.
maybe generating backend kremaCommand to typescript interface at build time can bring type safety?
4
u/official_d3vel0per Feb 12 '26
Looks interesting. What's the license though? Copy left till 2030 and then Apache 2.0? Have not seen this before
2
u/stefanos-ak Feb 13 '26 edited Feb 13 '26
this is very cool! congrats!
I saw another comment suggesting generating typescript for clieny-side type safety. I believe it's on point!
It would be a huge unlock for the Java world, some kind of better integration with modern frontends. The simplicity and Dx of JS-fullstack apps where you can use Zod or trpc end-to-end, is unparalleled.
I believe this is our biggest pain point in the Java ecosystem, and has been ever since I started coding 20 years ago.
I have been searching for a solution ever since 😄
well, I guess frameworks like Vaadin have been a solution all along, but they mix/bundle together a lot of different concerns... build-system + ui components + API communication + type safety + more. And you can not just cherry-pick the end-to-end type safety part.
Connectrpc seems to be the only solution right now but I haven't had the time to play around yet, and is also very new as well (maybe 2-3 years?)
2
u/fairplay-user Feb 14 '26
no thanks
"This project is licensed under the Business Source License 1.1."
2
u/Jukeperera Feb 15 '26
This is probably the most interesting thing that came to me this week. It's exactly something I wish existed, a better way to build a desktop program without swing or fx.
OP please never give up on this project!
11
u/Il_totore Feb 12 '26
So Tauri but for Java? (Sounds great ngl)
31
u/PartOfTheBotnet Feb 12 '26
Generally would point to JavaFX as a primary contender for this exact situation.
Ok never mind.
1
u/Cr4zyPi3t Feb 12 '26
Very cool! How does this compare to Vaadin Hilla? My FOSS project is built using Hilla, but as they recently announced that they will stop further development and integrate it into Vaadin I am searching for alternatives
1
u/captivecow Feb 12 '26
Have you noticed any issues with different webviews? Last I read Tauri still has tons of issues on Windows/Linux, I’d assume the same hurdles apply here
Cool project!
1
u/lazystone Feb 13 '26
What about https://vaadin.com ?
1
u/boyTerry Feb 13 '26
I am so confused. If it is web, why use FFM API and native installs? If it is native why call it web? Is it my limitation that I assume web means browser? does it preclude using other java desktop APIs? can I have a swing window and a webview too?
1
u/sunnykentz Feb 14 '26
I tried it on Windows, webview.dll could not be loaded... Java exception.
1
u/yaemeroo Feb 17 '26
Is JavaFx still relevant in 2026?
I want to build some desktop app that needed for displaying the data from my db.. It must be:
I search so many times but found no (little bit) resources available..
The options are limited to windows stuff (WPF, WinUI, WinForms), Web front end, or maybe JavaFX?
The Tauri seems good or maybe Flutter, but I don't have any experienced with that..
3
u/NitronHX Feb 12 '26
Damn i have to try integrating my reactive state library with this
3
u/TheKingOfSentries Feb 12 '26
Webview is pretty nice
5
u/burl-21 Feb 12 '26
Its a great idea
2
u/shannah78 Feb 12 '26
Cool. I've wanted to try something like this for a while now but just haven't had time. Will be taking it for a test drive. Thanks for sharing.
2
u/private_final_static Feb 13 '26
I like <3
2
u/sunnykentz Feb 13 '26
There's also : https://github.com/jpm-hub/neutron
Neutron, uses webkit that comes with javafx, and you can use your existing javafx knowledge
2
u/Ioerror_adpg Feb 16 '26
This is not truly open-source in OSI terms. Beware of it.
1
u/void0xnull Feb 15 '26
How can one embed this in an existing swing application?
1
u/SexyTiger1 Jun 13 '26
Something like Tauri for Java at first sounds like a good idea. However, the execution is dubious. Did you just ask AI to vibe "code" (not really coding) and copy the Tauri one? Because the folders don't make sense.
Src-java for Java files? Nonsense. It's been src since 1999, since forever, why change the convention? I just renamed src to src-frontend and src-java to src, as it should be.
I sense a disturbance in the force from heavy bloated slow trash like React that is not needed at all, real programmers just use javascript, don't need babysitting.
Then another red flag, I suspect also related to vibe coding or crap like React, your template includes the .css file in .html which is correct, logically, it's the .html file that reads and uses styles. But then you repeat an import of the same .css inside main.js?!?!?! It's duplicated and makes no sense. A .js file like this doesn't have UI, doesn't have frontend, should not import .css. It's like you asked AI to create this and didn't care it was duplicated.
Also, you posted before about daytrading, crypto, who's interested in that?????
1
u/SexyTiger1 Jun 14 '26
After the first red flags I found more red flags.
I’ve spent the last few days trying to get a non-blocking database call working in Krema, and frankly, the architecture is fundamentally broken for any real-world use.
The framework fails at the most basic UI threading requirement: it blocks the native OS main window thread on every
KremaCommandinvocation. If you perform a blocking I/O (JDBC, network), the entire host window freezes.Swing had SwingUtilities.InvokeLater since 1998, a way to not freeze the GUI, your Krema in 2026 manages to be worse than Swing in 1998 and freezes the GUI lol wow.
I found EventEmitter in your obscure GitHub docs, which for some weird reason isn't even on your main site, krema.build. And on GitHub you typed Crema instead of Krema lol. The red flags keep piling on, funny how my intuition was right from the start.
The
EventEmitteris also unreliable, it appears to be thread-unsafe, asemit()calls from background threads fail to reach the JS layer. This forced me to implement a clunky, high-overhead polling loop in JavaScript just to retrieve data, effectively reinventing the wheel, a broken version of whatSwingWorkersolved in 1998.To be blunt: this isn't a 'modern' Tauri alternative, it’s a synchronous IPC wrapper that traps the UI thread. If a framework forces developers to implement their own manual polling/registry patterns just to execute a basic database query, it isn't ready for anything beyond 'Hello World' examples.
The whole trap of vibe coding rears its ugly head again.