JVM replacement for the browser
Deprecation noticeCheerpJ 2 is deprecated. Consider migrating to CheerpJ 3 .
CheerpJ 3.0 now available
CheerpJ is a drop-in replacement for the JVM. It has extensive compatibility with Java 8 (tested on Oracle Forms, EBS, Swing, AWT and numerous frameworks and libraries), including Swing, reflection and dynamic class loading.
With CheerpJ, you can:
- Run existing Java applications in the browser with no changes
- Include Java applets in pages without legacy plugins
- Migrate Java Web Start / JNLP applications to work on modern systems
- Use Java libraries in JavaScript/TypeScript seamlessly
CheerpJ is based on a full OpenJDK runtime environment and supports:
- Networking
- Virtualized filesystem
- Clipboard
- Audio
- Printing
Getting started
Know what youβre building? Jump straight to the relevant tutorial:
What is CheerpJ?
CheerpJ is constituted of three components:
- The CheerpJ AOT compiler, an LLVM-based Java-bytecode to JavaScript compiler. The CheerpJ AOT compiler is available for Linux, macOS and Windows.
- The CheerpJ runtime library, a full Java SE runtime in WebAssembly and JavaScript. The CheerpJ runtime is cloud-hosted and accessed by the community free of charge for non-commercial purposes only. For self-hosting and commercial please visit our licensing page.
- The CheerpJ on-the-fly Java-to-JavaScript compiler, a reduced JavaScript version of the CheerpJ compiler that can be distributed with applications compiled with CheerpJ to enable dynamic features of Java such as reflection.
What is unique about CheerpJ?
- CheerpJ can handle 100% of Java 8, including Swing, reflection and dynamic class loading with no manual intervention on the code.
- CheerpJ works directly on Java bytecode, and does not require access to the Java source code.
- CheerpJ comes with a full Java SE runtime, inclusive of Swing/AWT. It supports audio, printing, and any other Java SE features. The runtime supports WebAssembly for optimal performance and size.
- The JavaScript code generated by CheerpJ is highly optimised and garbage-collectible.
- CheerpJ enables bidirectional Java-JavaScript interoperability. JavaScript libraries, as well as the DOM, can be called and manipulated from Java. Converted Java modules can be invoked from JavaScript.
- CheerpJ supports Java multi-threading. In addition, it allows one to create concurrent applications by using WebWorkers.
Licensing
CheerpJ is free for technical evaluation and non-commercial use. See licensing for details.
Demos
Several demos of CheerpJ can be found here.