I feel like Java is a step backwards in a lot of ways on this.
Thinking of playing with web-view[1] and Deno to see if I can get them co-mingled somehow... Then creating some sort of transparent host/communication layer between UI and backend. Then get something that can be compiled to a single platform executable... Linux deps get interesting, so a good story for flatpack/flathub, appimage and snap would be a followup. No ideas yet on iOS or Android.
1. https://github.com/Boscop/web-view