Java Virtual Machine for modern web browsers
CheerpJ is a WebAssembly-based Java Virtual Machine for the browser. It has extensive compatibility with Java 8 and provides a full runtime environment1 for running Java applications, applets, libraries, and Java Web Start / JNLP applications in the browser without plugins.
Not a developer? Check out our product website and our ready-to-use browser extension for running Java Web Start applications.
Features
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
- Interoperate between Java and JavaScript libraries
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:
How does CheerpJ work?
CheerpJ is a combination of two components:
- An optimising Java-to-JavaScript JIT compiler.
- A full Java SE 8 runtime based on OpenJDK.
Both are written in C++ and are compiled to WebAssembly & JavaScript using Cheerp.
What’s unique about CheerpJ?
- Extensive support for 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 the CheerpJ JIT 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. Also, Java modules can be invoked from JavaScript.
- CheerpJ supports Java multi-threading. In addition, you can create concurrent applications by using Web Workers.
Licensing
CheerpJ is free for personal use and technical evaluation. See licensing for details.
Demos
Several demos of CheerpJ can be found here.
You can also see CheerpJ in action in JavaFiddle:
Community
CheerpJ is used in production by teams at NASA, Siemens, UBS, and many others.
There are several community projects that use CheerpJ, such as:
-
Boardspace
A board game playing application using AWT. Over 100 games are available to play against human and robot opponents using WebSockets.
-
Browsercraft
Minecraft running unmodified in the browser!
We have a vibrant Discord community where you can ask questions, share your projects, and get community support.
Join our Discord server Follow us on TwitterFootnotes
-
CheerpJ has been tested on Oracle Forms, EBS, Swing, AWT, and numerous frameworks and libraries. It should be able to run Java SE applications that you would otherwise need a Java Runtime Environment for. ↩