Highlights:

  • CheerpJ 4.3 is now generally available
  • Users can upload files from a Java window’s title bar
  • Files saved to a new downloads directory reach the user’s machine
  • Long-press on touch screens acts as mouse hover
  • Stability and performance improvements for Java 11 and 17
  • Full release notes available here

What is CheerpJ?

CheerpJ is a full WebAssembly-based Java platform for modern browsers. It comes with a complete OpenJDK runtime and an emulation layer that provides file system access, networking and other OS-level features. It runs entirely client-side, with no Java installation, plugin or server-side component.

CheerpJ supports Java 8, 11 and 17. It runs existing applications, applets and Java Web Start applications unmodified, and with Library Mode it lets web applications use Java libraries directly from JavaScript.

CheerpJ 4.3 is a release focused on stability and on the experience of the people using Java applications in the browser.

Files in and out of the browser

A browser cannot give a web application direct access to the local file system. CheerpJ gives Java applications a virtual file system instead, with /app/ for files served by your web server, /files/ for persistent storage in the browser and /str/ for data passed in from JavaScript.

Until now, moving a user’s own files in and out of that file system needed some JavaScript on the page. CheerpJ 4.3 handles both directions with no extra code:

  • Upload. Every decorated Java window has an upload icon in its title bar. The user picks a local file and it is imported into the virtual file system.
  • Download. Any file the application saves to /files/downloads/ is downloaded to the user’s machine.

The filesystem guide describes each mount point.

Better on touch screens

AWT and Swing are designed around a mouse. Swing menus, for example, open submenus when the pointer hovers over an item, and a touch screen has no hover.

CheerpJ 4.3 interprets a long press as a mouse hover, so users can navigate menus and other hover-driven components on phones and tablets. Pointer and touch event handling has also been improved, giving smoother and more reliable interaction on mobile devices.

Stability and performance

Since CheerpJ 4.2 we have kept improving the stability and performance of the Java 11 and Java 17 runtimes. Full graphical applications such as the FlatLaf demo now run smoothly in the browser.

Upgrading

Upgrading is a matter of changing the version in the loader URL:

<script src="https://cjrtnc.leaningtech.com/4.3/loader.js"></script>

Technical resources

The complete technical release notes for CheerpJ 4.3 are on our technical blog. The changelog lists every change, and the documentation has guides, examples and tutorials.