Run your internal Java application in the browser

CheerpJ runs your existing Java application, applet or Java Web Start application in any modern browser, served from your own web server, with no Java installation on users’ computers.

Release a new build once, and staff get it the next time they open the application, with no desktop rollout and no Java installation to keep in step.

index.html
<script src="https://cjrtnc.leaningtech.com/4.3/loader.js"></script>
<script type="module">
  await cheerpjInit();
  cheerpjCreateDisplay(800, 600);
  await cheerpjRunJar("/app/my_application.jar");
</script>

Get it running in three steps

CheerpJ runs the compiled JAR files you already have, so you don’t need the source code. The second step depends on whether you have a Java application, an applet or a Java Web Start application.

To get started, you need:

  • Your application’s JAR files, or its .jnlp file
  • An HTML page to load it from
  • A simple HTTP server to test the page locally
  1. Create a project directory

    Create a folder for the project and copy your JAR files into it, keeping any folder structure the application expects.

    Terminal
    mkdir my-app
  2. Create an HTML page for your application

    Choose your type of application.

    Load CheerpJ, create a display for the application’s windows, then start the JAR with cheerpjRunJar. If the application isn’t started with java -jar, use cheerpjRunMain with the main class and the JAR files instead, as in the Java Web Start example.

    index.html
    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="utf-8" />
        <title>My application</title>
        <script src="https://cjrtnc.leaningtech.com/4.3/loader.js"></script>
      </head>
      <body>
        <script type="module">
          await cheerpjInit();
          cheerpjCreateDisplay(800, 600);
          await cheerpjRunJar("/app/my_application.jar");
        </script>
      </body>
    </html>
  3. Host your page

    Serve the project directory with any HTTP server, such as http-server. Opening the HTML file directly from disk doesn’t work.

    Terminal
    npx http-server -p 8080

The result

Open the page and you’ll see the CheerpJ display with some loading messages, then your application. Depending on the application and the optimisations applied, this can take a few seconds. If it doesn’t start, check that the JAR paths begin with /app/, which is the root of your web server, and that the application runs normally on your computer without CheerpJ.

Key Features

01

Full Java environment in HTML5

CheerpJ enables modern browsers to run any Java Application and Applet, as well as Java libraries.

02

Legacy Modernization

With CheerpJ, you can run legacy Java Applets and Applications on modern browsers, removing the requirement for IE, Edge IE mode, and for a local Java installation.

03

Effortless Deployment

CheerpJ does not need access to the source code at all, operating at the level of Java bytecode. Third-party libraries, dependencies and obfuscated code pose no issue.

04

JVM replacement

CheerpJ core component is a Java Bytecode JIT compiler in WebAssembly.

05

Full Runtime

CheerpJ comes with a full OpenJDK runtime environment, ensuring that existing applications ‘will just work’. This includes Java Swing, AWT, and any other runtime component.

06

Full Classloader Support

CheerpJ can now give full control to the appropriate Classloader for class resolution, including application-provided ones. This completely eliminates incompatibilities caused by duplicated classes as well.

07

Scalable JNI Architecture

CheerpJ compiles 100% of the OpenJDK native code to WebAssembly, providing a viable path for supporting modern versions of Java and potentially specific point versions if a user requires.

08

Java-JavaScript Interoperability

CheerpJ provides multiple mechanisms for Java and JavaScript to interoperate.

09

Networking and System Features

CheerpJ provides a full networking stack (HTTP(s), TCP/IP), as well as support for file access, networking (HTTP and TCP), clipboard, audio, printing, and more.

Here Are the Most Frequent Questions

More FAQs
What types of applications does CheerpJ support?

CheerpJ can run Java Applets, Java Web Start applications, stand-alone Java applications (including Swing), and Java libraries, on any modern browser that supports WebAssembly.

How do we release a new version?

The application files are hosted on your own web servers and loaded when a user opens the page. When your team publishes a new build, staff receive it the next time they open the application, without a desktop rollout or a Java installation to keep in step.

Can the application run inside our network?

Yes. CheerpJ and the application are static files, so they can be served from an internal web server or private cloud and integrated with your existing authentication. Staff can use the application on thin clients and locked-down computers that can’t install Java, since nothing is installed on the device.

Which Java versions can the application use?

CheerpJ 4.3 supports Java 8, 11 and 17, and runs Java 8 unless you choose another version. Applets run on Java 8. See Java versions for the details.

Is CheerpJ secure?

CheerpJ is a full JVM in WebAssembly, running client-side within the browser sandbox. It has no native or server-side components. As such, it benefits from the Web security model, drastically improving the application security profile compared to standard Java applications.

Do we need a licence?

An internal application used by employees needs a CheerpJ Commercial License, which also covers self-hosting. Technical evaluation before the application reaches users is free and unmetered. See licensing and pricing for the options.

Learn More About CheerpJ

Applets ·

How to Run Java Applets Without Installing Java

The CheerpJ Applet Runner extension runs legacy Java applets in Chrome without installing Java, compiling them on the fly so data stays inside your browser.

Build with Java for the browser.