Your Java files
JARs, classes, libraries and resources, as they are compiled now. No source code is needed.
CheerpJ is a Java Virtual Machine and a full build of OpenJDK for the browser, implemented in WebAssembly and JavaScript. It runs your compiled Java bytecode as it is, with no source code, recompilation, plug-in or local Java installation.
A desktop Java application needs a Java runtime installed on every device. CheerpJ serves the runtime and the application as web files, and runs the existing bytecode in the browser.
JARs, classes, libraries and resources, as they are compiled now. No source code is needed.
A JVM and the OpenJDK class library, served as static files from your web server or the CheerpJ CDN.
Chrome, Edge, Firefox or Safari, on desktop or mobile, with no plug-in and no local Java runtime.
The application and its backend stay as they are. Only the way the application reaches users changes.
CheerpJ provides a Java runtime and the operating-system services a Java application expects, built on browser APIs.
A JVM written in C++ and compiled to WebAssembly and JavaScript, with the full OpenJDK class library of each supported Java version.
Each AWT and Swing window is an HTML element with its own canvas, and frames and dialogs get an HTML title bar. Multiple windows and keyboard focus work as on the desktop.
Your web server, read over HTTP; persistent storage in the browser; and memory for data passed in from JavaScript. Read the file system guide.
HTTP and HTTPS through the browser’s own networking. TCP and UDP through Tailscale, a WireGuard VPN carried over WebSockets. Read the networking guide.
CheerpJ loads the runtime, reads the existing application files and runs the Java bytecode in the browser tab.
A script tag loads CheerpJ from your web server or the CheerpJ CDN. The page starts the runtime with cheerpjInit, which chooses the Java version, and the application with cheerpjRunJar or cheerpjRunMain. On Java 8, the page’s applet tags start on their own.
The JARs are served from your web server. CheerpJ downloads the parts the application needs, as it needs them, in chunks with HTTP Range requests. The browser’s cache keeps them for the next visit.
Execution starts in an interpreter, which also counts how often each part of the code runs.
Code that runs often is compiled to JavaScript while the application runs. The compiler inlines and devirtualises calls, and the browser’s JavaScript engine runs the result.
The window manager draws the interface in the page. Files, network connections, the clipboard, printing and audio go through the browser’s APIs, inside its sandbox.
Bytecode starts in an interpreter, and code that runs often is compiled to JavaScript. Your bytecode is not compiled ahead of time, and no part of CheerpJ runs on a server.
Java threads are scheduled by CheerpJ and take turns on one browser thread: the page’s own, or a Web Worker’s when CheerpJ is started in one.
Java objects are ordinary JavaScript objects, garbage-collected by the browser. Weak references and finalizers use the browser’s own mechanisms.
OpenJDK’s own native code is compiled to WebAssembly. The application’s native methods can be implemented in JavaScript or compiled to WebAssembly. Pre-built binaries, such as .dll and .so files, cannot run in a browser.
CheerpJ provides a browser-based equivalent for each service a locally installed Java runtime gives an application. The compatibility page lists what is supported in detail.
| Java application component | How CheerpJ handles it |
|---|---|
| Java bytecode | Run unchanged by the CheerpJ JVM: interpreted first, then compiled to JavaScript where it runs often |
| Java standard library | The full OpenJDK class library of the chosen Java version, with OpenJDK’s native code compiled to WebAssembly |
| Swing and AWT interfaces | Drawn by the window manager with HTML elements and canvases |
| JARs and dependencies | Read from your server as they are, including third-party libraries, obfuscated code and classes loaded by custom class loaders |
| Files | Virtual file systems: your server over HTTP, browser storage and memory. Local files enter as uploads and leave as downloads |
| HTTP and HTTPS | Through the browser’s networking, under its security model. Services on another domain must allow cross-origin requests |
| TCP and UDP | Through Tailscale, with a control server you can host yourself |
| Clipboard, printing and audio | An internal clipboard by default, with the system clipboard as an option; printing through the browser’s print dialog; audio through the Web Audio API |
| External processes | Runtime.exec does not start a process. A JavaScript function you supply can handle the command instead |
| JavaScript integration | Java calls JavaScript through native methods, and JavaScript uses Java classes in library mode. See interoperability |
| Native libraries | Implemented in JavaScript or compiled to WebAssembly. Pre-built .dll and .so files cannot run |
CheerpJ runs the Java application on the user’s device, inside the browser. There is no remote desktop or streaming session for each user.
Java code runs in the user’s browser, not on an application server.
The runtime and the JARs are static files on any web server or CDN. There is no server-side process, API or database.
The application keeps using its APIs and services, subject to browser policies and networking configuration.
Files are updated on the server, not on every device. Self-hosted deployments never update automatically.
Deployment covers the server and browser requirements, and the comparison sets CheerpJ against remote sessions and rewrites.
Java code has no direct access to the operating system. It reaches files and the network only through the CheerpJ runtime and the browser, under the same rules as any web page.
The security page describes the model in detail.
CheerpJ 5.0 supports Java 8, 11, 17 and 21, with Java 25 in preview, and runs these kinds of application.
Swing and AWT applications, run from their JAR files.
On Java 8, through CheerpJ Core on your own pages, or the Applet Runner on pages you do not control.
JNLP applications through the JNLP Runner, on Java 8, or with CheerpJ Core, by running the JARs the JNLP file lists.
Forms 6i, 10g, 11g and 12c applications, and the Forms-based parts of Oracle E-Business Suite, without desktop Java. See Oracle Forms.
Java classes, objects and arrays used from JavaScript in a web application, in library mode.
Compatibility depends on the APIs, native libraries, network protocols and operating-system integrations an application uses. The compatibility page lists them.
Integrate CheerpJ into a web application, or use a browser extension for existing applets and Java Web Start applications.
Add CheerpJ to a web page, and start an application or library with its JavaScript API, or run the page’s applets. Your team controls the page, authentication, deployment and integration with other web components.
About CheerpJ CoreThe Applet Runner and JNLP Runner run existing applets and Java Web Start applications in Chrome and Edge, without changes to the page. IT can force-install them by Group Policy.
Explore the extensions