I am very sorry, but I did not find a simple solution to bring my java project(s) to the web...
Thanks for pointing it out, I think my next project will be web-compatible.
I'm not really aware of how much new development is going into Java Applets; but they were quite popular in the early 2000s; if you do a search for "Java Applets" you could maybe give a go at looking into that - it may be a way to go if you're keen on sticking with Java for your game development - and you wanna try to ease distribution inside web browsers. I had prototyped some basic games (like snake) in Java but moved to other frameworks over the years; currently my favorite tool for gamedev is the open-source Godot engine.
I've dabbled with lots of different environments for gamedev; currently Godot is my favorite. I got into Godot by hitting up their homepage and running over all the tutorials/learn-godot pages they had on their homepage; if you like Zelda games, there is a Zelda-like Godot tutorial on Youtube that helped me pick up a lot of ideas too.
Though this is not a solution to bring the game to the web there are multiple solutions to bundle java with the game so the user doesn't have to have it installed.
If I remember correctly there are multiple threads discussing various way on the jmonkey engine forum (a game engine for java) https://hub.jmonkeyengine.org/ maybe it helps in the future. I believe that there was also talk about WASM there, however I don't think much happened with that.