Java 2 min read

CheerpJ 5.0 Adds Java 21 and 25 Support for WebAssembly

Leaning Technologies has released CheerpJ 5.0, bringing support for Java 21 and 25 to the browser along with an experimental WasmGC execution engine.

CheerpJ 5.0 arrived on November 2, 2026, adding support for Java 21 and 25 to Leaning Technologies' OpenJDK distribution for WebAssembly. This release completes a roadmap from February 2025 and joins existing support for Java 8, 11, and 17. Java 25 is currently in preview, with small and medium applications expected to work while very large ones likely expose issues, whereas Java 11 and 17 are stable enough for most applications out of the box.

Following I/O optimizations, every supported version now ships with the full JDK instead of only JRE packages, allowing both javac and jshell to run in the browser.

CheerpJ 5.0 introduces an experimental execution engine built on the WebAssembly GC extension, adding a new interpreter and second JIT backend alongside the default engine where Java objects map to JavaScript objects. The WasmGC engine turns Java objects into WasmGC objects, compiles hot code to WebAssembly, and relies on the browser's garbage collector for memory management. You can enable it via await cheerpjInit({ wasmGC: true });, but it requires Chrome or Edge 137, Firefox 153, or Safari 27 (including iOS and iPadOS 27) or later. Because it lacks automatic fallback and is unstable, the default engine remains active, and production use of WasmGC is not advised until CheerpJ 6.0 in early 2027.

The software operates at the bytecode level to support obfuscated JARs and JVM languages like Kotlin and Scala without source code. While Swing and AWT applications run, JavaFX and SWT remain unsupported. Other updates include faster class-file parsing, a re-tuned JIT, optimized JAR downloads, and library mode for calling Java libraries from JavaScript via async/await.

Licensing is commercial, offering a free Community license for personal, educational, hobby, evaluation, single-person, and non-commercial open-source use. Commercial tiers include desktop licenses, application licenses, and enterprise options adding self-hosting, support, and redistribution.