---
title: "CheerpJ"
source: "https://cheerpj.com/docs/overview"
---

# CheerpJ

Real Java, for the browser.

![Version 5.0](https://img.shields.io/badge/version-5.0-orange)[![Discord server](https://img.shields.io/discord/988743885121548329?color=%237289DA\&logo=discord\&logoColor=ffffff)](https://discord.leaningtech.com/)[![GitHub issues](https://img.shields.io/github/issues/leaningtech/cheerpj-meta.svg?logo=github)](https://github.com/leaningtech/cheerpj-meta/issues)

[![Java 8: OpenJDK 8u512](https://img.shields.io/badge/Java_8-8u512-e5e5d6?labelColor=1e1e1e)](https://cheerpj.com/compatibility/)[![Java 11: OpenJDK 11.0.33](https://img.shields.io/badge/Java_11-11.0.33-e5e5d6?labelColor=1e1e1e)](https://cheerpj.com/compatibility/)[![Java 17: OpenJDK 17.0.21](https://img.shields.io/badge/Java_17-17.0.21-e5e5d6?labelColor=1e1e1e)](https://cheerpj.com/compatibility/)[![Java 21: OpenJDK 21.0.13](https://img.shields.io/badge/Java_21-21.0.13-e5e5d6?labelColor=1e1e1e)](https://cheerpj.com/compatibility/)[![Java 25: OpenJDK 25.0.5, in preview](https://img.shields.io/badge/Java_25-25.0.5_\(preview\)-e5e5d6?labelColor=1e1e1e)](https://cheerpj.com/compatibility/)

CheerpJ is a **Java Virtual Machine and a full build of OpenJDK for the browser**, implemented in WebAssembly and JavaScript. It runs Java 8, 11, 17 and 21, with Java 25 in preview: applications, applets, Java Web Start applications and libraries, from their compiled JARs, with no source code, recompilation, plug-in or local Java installation.

[Get started](https://cheerpj.com/docs/getting-started.md) · [Tutorials](https://cheerpj.com/docs/tutorials.md) · [API reference](https://cheerpj.com/docs/reference.md) · [GitHub repository](https://github.com/leaningtech/cheerpj-meta) · [Licensing](https://cheerpj.com/docs/licensing.md)

```html
<script src="https://cjrtnc.leaningtech.com/5.0/loader.js"></script>
```

![Java applications, applets, JNLP apps and libraries run through CheerpJ, a WebAssembly JVM, in any modern browser](https://cheerpj.com/docs/_astro/explanation-diagram.Cc8QOnlA_2xbdF.webp)

## Choose your path

Each getting started guide takes one kind of Java program from its JARs to a running page:

- **Application:** a desktop Swing, AWT or console application
- **Applet:** an applet on a page you control, on Java 8
- **Library:** Java classes called from JavaScript or TypeScript
- **Java Web Start:** an application launched from a JNLP file

[Application → ](https://cheerpj.com/docs/getting-started/Java-app.md)[Applet → ](https://cheerpj.com/docs/getting-started/Java-applet.md)[Library → ](https://cheerpj.com/docs/getting-started/Java-library.md)[Java Web Start →](https://cheerpj.com/docs/getting-started/JNLP.md)

To run Oracle Forms or Oracle E-Business Suite, see [Oracle Forms](https://cheerpj.com/oracle-forms/) and [Oracle EBS](https://cheerpj.com/oracle-ebs/) on cheerpj.com.

## Quick start

You need your JAR files, an HTML page and a web server. Put the JAR in a folder with this `index.html`:

`index.html`

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <script src="https://cjrtnc.leaningtech.com/5.0/loader.js"></script>
  </head>
  <body>
    <script type="module">
      await cheerpjInit();
      cheerpjCreateDisplay(800, 600);
      await cheerpjRunJar("/app/my_application.jar");
    </script>
  </body>
</html>
```

Serve the folder and open `http://localhost:8080`:

```sh
npx http-server -p 8080
```

- [`cheerpjInit`](https://cheerpj.com/docs/reference/cheerpjInit.md) starts CheerpJ. Its options choose the Java version, the clipboard mode, networking and more.
- [`cheerpjCreateDisplay`](https://cheerpj.com/docs/reference/cheerpjCreateDisplay.md) creates the area of the page that holds the Java windows.
- [`cheerpjRunJar`](https://cheerpj.com/docs/reference/cheerpjRunJar.md) runs the application, as `java -jar` does. For `java -cp … com.example.Main`, use [`cheerpjRunMain`](https://cheerpj.com/docs/reference/cheerpjRunMain.md).
- `/app/` is the root of the web server the page comes from, as Java sees it. Forgetting the `/app/` prefix is the most common first mistake.

> **Use a web server**
>
> Open the page over http\:// or https\://, never file://. The server must support HTTP Range requests, which Python’s http.server does not. See server setup.

[Get started →](https://cheerpj.com/docs/getting-started.md)

## How CheerpJ works

1. **The page loads CheerpJ.** One script tag loads the JVM and the OpenJDK class library, from the CheerpJ CDN or your own web server. `cheerpjInit` starts the runtime and chooses the Java version.
2. **CheerpJ runs your bytecode as it is.** The JARs are read from your web server, in chunks, as the application needs them. An interpreter starts running the bytecode, and a JIT compiler turns the code that runs most often into optimised JavaScript.
3. **The application runs in the browser tab.** A window manager draws Swing and AWT windows with HTML elements and canvases. Files, networking, the clipboard, printing and audio go through browser APIs, inside the browser sandbox.

Nothing runs on a server: CheerpJ is a set of static files, and the application runs on the user’s own device. [Architecture](https://cheerpj.com/docs/explanation/architecture.md) explains each part, and [How CheerpJ works](https://cheerpj.com/how-cheerpj-works/) gives the overview.

## What CheerpJ supports

|                   |                                                                                                                                                                 |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Java**          | Java 8 (the default), 11, 17 and 21, with Java 25 in preview, chosen with the [`version`](https://cheerpj.com/docs/reference/cheerpjInit.md#version) option     |
| **Language**      | The whole Java language and bytecode, including reflection, proxy classes, custom class loaders and obfuscated code                                             |
| **Applications**  | Desktop applications, applets (Java 8), Java Web Start / JNLP applications, Oracle Forms and EBS, and libraries                                                 |
| **UI**            | Swing and AWT, with multiple windows                                                                                                                            |
| **Files**         | [Virtual file systems](https://cheerpj.com/docs/explanation/File-System-support.md) on your web server, in browser storage and in memory; uploads and downloads |
| **Networking**    | HTTP and HTTPS through the browser; TCP and UDP through [Tailscale](https://cheerpj.com/docs/guides/Networking.md)                                              |
| **Desktop**       | [Clipboard](https://cheerpj.com/docs/reference/cheerpjInit.md#clipboardmode), printing and audio                                                                |
| **Native code**   | [Native methods](https://cheerpj.com/docs/guides/implementing-native-methods.md) in JavaScript or compiled to WebAssembly                                       |
| **Browsers**      | Chrome, Edge, Firefox and Safari, on desktop and mobile                                                                                                         |
| **Not supported** | JavaFX, SWT, and pre-built native binaries (`.dll`, `.so`, `.dylib`)                                                                                            |

The [compatibility page](https://cheerpj.com/compatibility/) has the full tables, including minimum browser versions.

## Try it

Write and run Java in the browser with [JavaFiddle](https://javafiddle.leaningtech.com/), which is built on CheerpJ:

More to try, with nothing to install:

- [Browsercraft](https://browsercraft.cheerpj.com/): the original Minecraft 1.2.5 client, running unmodified in a browser tab
- [Showcase](https://labs.leaningtech.com/showcase?product=CheerpJ): projects built with CheerpJ, such as FlatLaf, PhET simulations, ImageJ.js and Logisim
- [Tutorials](https://cheerpj.com/docs/tutorials.md): complete examples, with their source in the [cheerpj-meta repository](https://github.com/leaningtech/cheerpj-meta/tree/main/examples)

## Not a developer?

The CheerpJ browser extensions run existing applets and Java Web Start applications in Chrome and Edge, with no changes to the page and no Java installation. They need no technical knowledge to install, and IT departments can deploy them with Group Policy. See [CheerpJ extensions](https://cheerpj.com/extensions/).

[Run Java Applets in your browser.](https://cheerpj.com/extensions/)

[CheerpJ Applet Runner](https://cheerpj.com/extensions/)

[Run Java Web Start apps in your browser.](https://cheerpj.com/extensions/)

[JNLP Runner](https://cheerpj.com/extensions/)

## Using a coding agent?

Install the [CheerpJ skill](https://github.com/leaningtech/skills). It covers converting `java` command lines, JARs, applets, JNLP files, Oracle Forms and libraries, and the common errors:

```sh
npx skills add leaningtech/skills --skill cheerpj
```

Or point your agent at [cheerpj.com/agents.md](https://cheerpj.com/agents.md) or [cheerpj.com/llms.txt](https://cheerpj.com/llms.txt).

## Licensing

CheerpJ is free for personal, educational and hobby use, and for technical evaluation by organisations of any size. One-person companies and non-commercial open-source projects can use it for free with a “Built with CheerpJ” credit. Business use needs a licence. See [licensing](https://cheerpj.com/docs/licensing.md) for a summary and examples, and [cheerpj.com/licensing](https://cheerpj.com/licensing/) for the full terms and prices.

## Getting help

| Where                                                               | Best for                                                    |
| ------------------------------------------------------------------- | ----------------------------------------------------------- |
| [Discord](https://discord.leaningtech.com/)                         | Questions, help getting started, and showing what you built |
| [GitHub issues](https://github.com/leaningtech/cheerpj-meta/issues) | Bugs in CheerpJ or the browser extensions                   |
| [Contact us](https://cheerpj.com/contact/)                          | Licensing, commercial support and enterprise deployments    |

Before you report a bug, read [debugging CheerpJ](https://cheerpj.com/docs/guides/cheerpj-debug.md) and the [FAQ](https://cheerpj.com/docs/faq.md). A good report names the CheerpJ version (from the loader URL), the Java version passed to `cheerpjInit`, your browser and operating system, and includes the full browser console output.

## Community

CheerpJ has been in production since 2017. Over a million people ran a CheerpJ application in the last 12 months, and the CheerpJ browser extensions have more than 170,000 users. It is used by NASA, Ticketmaster, Moody’s, ADP and [many other organisations](https://cheerpj.com/customers/).

[View community projects →](https://cheerpj.com/docs/community)

The CheerpJ team and community answer questions on Discord, where you can also share your projects.

[Join our Discord server ](https://discord.leaningtech.com/)[Star us on GitHub](https://github.com/leaningtech/cheerpj-meta)
