r/java • u/alexp_lt • 27d ago
CheerpJ 5.0: Java 21/25 in the browser, full OpenJDK, and a new WasmGC engine
https://labs.leaningtech.com/blog/cheerpj-5.0Hi all, I work at Leaning Technologies. We've released CheerpJ 5, which runs Java 21 and 25 applications in the browser and now ships JDK packages by default, so that javac runs in the browser too. There's also an experimental WasmGC backend. Happy to answer any questions!
98
Upvotes
9
u/headius 27d ago
We have a JRuby user doing some interesting experiments with CheerpJ, and I'm sure they're going to be excited that this release is finally out! I'll try to do some testing myself and see what improvements we can make in JRuby to run better in CheerpJ.
8
u/neopointer 27d ago
Looking forward for the day someone will build a frontend lib/framework that can beat react, etc. However, even if someone creates such a library with cheerpj, that's not going to fly with this license model as far as I can see. It's a big effort, so I can understand Cheerpj's choice. Great work btw.
3
u/zabby39103 27d ago
So basically Applets again, but with Wasm and the user doesn't need Java installed? That's cool. I wonder if I could resurrect some of the old Applet stuff I have.
3
u/Djelimon 26d ago
Does it support javafx?
2
u/Interesting-Tree-884 27d ago
Bonjour, est ce que la reflexion fonctionne? Merci.
12
u/jeffreportmill 27d ago
I’m a huge fan of CheerpJ - an amazing work of engineering and actually makes “Write Once Run Anywhere” true. Here’s my labor of love that would be almost pointless without browser support: https://reportmill.com/SnapCode .
2
u/AthRouge 27d ago
Congrats! Niche question: does it support the FFM API? Are Arena, MemorySegment and MemoryLayout supported? Could Linker downcalls target a C library compiled to WebAssembly? If so how transparent is it?
2
u/ChaoticPayload 27d ago
Internet Download Manager (IDM) keeps prompting me to download JAR files (e.g.,
https://cjrtnc.leaningtech.com/5.0/25/jre/lib/cheerpj-awt.jar) whenever I visit the website, as if I had clicked a download button. Is it possible to fix this server-side?7
u/tuser-reddit 27d ago
Wtf is going on? Java on the BROWSER! THEFUCK?
4
u/tonetheman 27d ago
This is amazing work. I am not sure where I would use it exactly... but I can see where you could do some interesting things with this.
1
u/BlackSuitHardHand 27d ago
I'm following the project for quite some time, and I really appreciate the engineering effort behind this. However, I really fail to see any practical application apart from lifting legacy desktop apps into web. The whole JVM as wasm approach is really heavyweight, and you don't get reponsive design out-of-the-box. Since you have to touch the code anyway, you could also lift these apps to more lightweight apps using frameworks like Vaadin or just let the LLM-of-your-choice rewrite it to a native webapp.
1
u/[deleted] 26d ago
[removed] — view removed comment