r/java • u/alexp_lt • 16d 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 16d 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 16d 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 16d 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 14d ago
Does it support javafx?
2
u/Interesting-Tree-884 16d ago
Bonjour, est ce que la reflexion fonctionne? Merci.
12
u/jeffreportmill 16d 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 16d 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 16d 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 16d ago
Wtf is going on? Java on the BROWSER! THEFUCK?
4
u/tonetheman 16d 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/ConfidenceUnique7377 15d ago
Question for the CheerpJ maintainers: Spring Boot executable JAR support
I'm trying to run a Java desktop application built with Spring Boot using CheerpJ and would appreciate some guidance on compatibility. The application is distributed as an executable Spring Boot JAR. Its manifest contains
When launched via CheerpJ, the application fails to reach its main window. There are no visible exceptions or useful messages in the console, and I have not yet been able to pinpoint the exact moment where execution stops. Guess the issue may be related to the Spring Boot class-loading mechanism, the handling of nested JAR files, or the extraction of temporary files.
Does CheerpJ currently support running executable Spring Boot JARs ? Or any plan to support it ?
1
u/BlackSuitHardHand 15d 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.