r/java • • Feb 12 '26

Krema: build modern desktop apps with Java backend and web frontend

https://github.com/krema-build/krema

i 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

63 comments sorted by

22

u/cowwoc Feb 12 '26

I don't personally need this but I love what you did. It's a great idea.

3

u/guybedo Feb 12 '26

thanks!

8

u/larsga Feb 13 '26

lightweight, native desktop applications ... frontend in React/Vue/Angular/Svelte

Soooo, not lightweight, native, then.

0

u/guybedo Feb 14 '26

i used to build apps with swing and needed to package jcef if i wanted to have a webview.

Compared to electron it is considered lightweight too

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?

1

u/guybedo Feb 12 '26

thanks for the suggestion

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

3

u/guybedo Feb 12 '26

it prevents people from forking the project and using it for commercial purpose. other than that any body can build an app with krema

1

u/Confident-Dare-9425 Feb 14 '26

That’s an ambitious license choice :)

1

u/guybedo Feb 14 '26

yeah i know LOL

2

u/Ioerror_adpg Feb 16 '26

For a project that probably will remain niche, this license is a nail in the coffin. I was considering spending time evaluating it for a personal project but that is a huge red flag to me. Good luck to the author though.

→ More replies (2)

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/guybedo Feb 13 '26

yeah i'm gonna work on generating typescript types in a next release, it shouldn't be too complicated to generate .d.ts files when compiling

→ More replies (1)

2

u/mands Feb 14 '26 edited Feb 14 '26

Yep, have hit this issue a lot.

There was Vaadin Hilla but it’s now discontinued. I spent a while looking at alternatives and actually settled on GraphQL. There is great Spring and JakartaEE support, and generating typescript from the schema works really well.

It’s actually quite a simple protocol when you focus on the core concepts, just ignore things like federation and dynamic queries, and instead think of it like typed RPC for queries and mutations.

Could actually be quite useful for this (really cool!) project to help foster Java / webview comms.

2

u/fairplay-user Feb 14 '26

no thanks

"This project is licensed under the Business Source License 1.1."

2

u/guybedo Feb 14 '26

This is the same licensing model used by companies like MariaDB, CockroachDB, and Sentry.

It's a "source-available" license designed to prevent cloud providers/competitors from offering the software as a service while still allowing broad community use.

The restriction is specifically about repackaging/reselling Krema itself, not about building things with it.

→ More replies (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!

2

u/guybedo Feb 15 '26

thanks! it's been a pain for me too, i was tired having to use swing or fx. Java is great but the lack of good solutions for desktop app was really annoying

11

u/Il_totore Feb 12 '26

So Tauri but for Java? (Sounds great ngl)

31

u/PartOfTheBotnet Feb 12 '26

i was looking for alternatives to swing to build modern desktop apps and i couldn't find anything

Generally would point to JavaFX as a primary contender for this exact situation.

and a web frontend

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/guybedo Feb 12 '26

i don't know about Vaadin Hilla, Krema let's you build your backend in regular java, then you have your npm + react|angular for the frontend. best of both worlds

→ More replies (1)

1

u/mands Feb 14 '26

See my other message, also recently moved from Hilla and ended up on GraphQL. Was about to build my own RPC but realised GQL had handled all of my concerns already.

→ More replies (3)

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/guybedo Feb 12 '26

i haven't noticed any issue yet, although it's been difficult to come up with the linking/bundling of required libs on windows

1

u/lazystone Feb 13 '26

What about https://vaadin.com ?

1

u/guybedo Feb 13 '26

isn't it used to build webapps in full java?

krema is for desktop apps with web frontend: react, angular....

→ More replies (3)

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?

2

u/guybedo Feb 13 '26

desktop apps, with web frameworks for the UI inside a webview. It's basically what tauri does in rust, or electron for full javascript desktop apps

1

u/boyTerry Feb 13 '26

I have been reading your very clean code to try to understand it, and I am liking what I see. I might need to run a couple experiments with it.

1

u/guybedo Feb 13 '26

cool! let me know how it goes. You're welcome to open issues on github, there's probably bugs lurking somewhere still

1

u/sunnykentz Feb 14 '26

I tried it on Windows, webview.dll could not be loaded... Java exception.

2

u/guybedo Feb 14 '26

i had a few problems with that, can you open an issue on github with erro details, krema version, etc... so i can work on it ?

Thanks!

→ More replies (1)

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:

  1. Stable (future proof)
  2. Fast for developement
  3. Can be used for old computer (win 10 with 4-8GB)

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..

1

u/guybedo Feb 17 '26

javafx isn't officially dead but it looks like it is.

You should give krema a try, it's like tauri but for java ecosystem. you can even build graalvm native binaries

1

u/emberko Feb 17 '26

It is. JavaFX is quite a mature platform that mainly suffers from bad font rendering and the inability to bring GraalVM goodies to the desktop on the technical side, and a lack of popularity and marketing on the community side. If I started anew, I’d choose between JavaFX and Avalonia. The latter because of the .NET 8 Native AOT feature that can produce really small 10-20 MB binaries. Tauri's biggest flaw is that you have to rely on the webview/webkit version, which may be obsolete or not even installed on the client side. I'd wait until WRY becomes a thing, although I have to admit that Dioxus (it's more or less like Vaadin for Tauri) looks quite tasty.

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/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 everyKremaCommand invocation. 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 EventEmitter is also unreliable, it appears to be thread-unsafe, as emit() 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 what SwingWorker solved 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.