CheerpJ 3.0 now generally available: Run any Java Application on Modern Browsers

After seven years from its initial release in 2017, having amassed over 130,000 downloads and tens of thousands of Enterprise users, we are delighted to announce that CheerpJ 3.0 is now generally available, marking a significant milestone in Leaning Technologies’ vision of running any application on the browser.

With CheerpJ 3.0, Java client applications, such as Java Applets, Java Web Start applications, and stand-alone Java Applications, can run unmodified on modern browsers, without a local Java installation. 

What is CheerpJ for?

CheerpJ is used in three main different scenarios:

  • Preserving access to legacy applications such as Java Applets, Java Web Start and stand-alone Java applications. In this context, CheerpJ allows organizations to drop the requirement for a Java Desktop installation, and for legacy browser versions. This improves security and compliance, and reduces maintenance costs.
  • Modernizing existing Java Desktop applications. CheerpJ provides a path to modernize Java-based applications by turning them into web applications with minimal intervention. Applications can then be gradually modernized to web-based standards, thanks to extensive JavaScript interoperability features.
  • Using Java components in Web applications. With CheerpJ, powerful Java libraries and components can be integrated seamlessly into web applications, executing browser-side. This would be traditionally achieved via server-side execution, but CheerpJ enables Java libraries to run on the browser, reducing latency and cloud costs while increasing security.

How does CheerpJ work?

CheerpJ is a WebAssemby-based JVM for the browser, equipped with a full JRE, and ensuring extensive compatibility with large-scale unmodified Java Applications of any kind.

CheerpJ 3.0 is a full rewrite of the CheerpJ technology, which was initially released in 2017. The new architecture brings several benefits:

  • JIT Compilation Takes Center Stage: CheerpJ 3.0 introduces a JIT-based execution model, similar to how the ‘standard’ Java Virtual Machine operates. This means that it operates on unmodified bytecode (JAR files), running them in-browser, and compiling them on the fly. Ahead-of-time compilation and .jar.js files are now deprecated. This makes CheerpJ 3.0 extraordinarily easy to deploy.
  • Comprehensive compatibility: The new JIT approach allows CheerpJ 3.0 to reach comprehensive compatibility with the Java language, including reflection and custom ClassLoaders.
  • Scalable Architecture: CheerpJ 3.0 new architecture now comes with an unmodified full build of the OpenJDK runtime, and the capacity to support multiple runtimes. This not only ensures a comprehensive compatibility with Java 8 applications, but also provides a path for supporting future releases of Java.
  • Powerful interoperability with JavaScript. CheerpJ 3.0 introduces powerful interoperability constructs, allowing Java to invoke JavaScript via ‘native’ Java methods, and introducing a new powerful async/await-based API to invoke Java from JavaScript.

CheerpJ is unique in that it is meant to run unmodified arbitrary Java client applications on the browser. As such, it comes with a full runtime environment, an unmodified build of OpenJDK. Thanks to its JIT nature, it supports any Java construct (including reflection) with no modifications. Full support for custom ClassLoaders, introduced in CheerpJ 3.0, means that Java applications of arbitrary complexity usually just work (have a look at how CheerpJ can run IntelliJ IDEA – over 400MB of JAR files).

Compared to other “Java on the browser” solutions, CheerpJ has no server-side component, does not require access to source code, is not opinionated (not being a framework), has full support for the Java language, and comes with a full OpenJDK runtime, ensuring extensive compatibility with real-world applications.

The result of 7 years of successes (and failures)

Since its initial release in 2017, CheerpJ has evolved from a pure-JavaScript solution, to partially using WebAssembly for its JNI, to embracing WebAssembly for the entire JVM in this latest release. It has evolved from being essentially an AOT Java compiler, into a JVM replacement.

Throughout these years, it has seen significant success in the Enterprise world, solving pressing issues of access to critical legacy applications based on Java Applets, Web Starts or stand-alone Java Clients. These issues are particularly relevant in the Oracle ecosystem, which is extraordinarily common in the Enterprise sector. 

CheerpJ has also proven to be a successful tool for the modernization of Java applications, providing a simplified path towards bringing Java content to modern web standards. CheerpJ enables partial or gradual re-writes, while still leveraging ‘converted’ Java components.

Finally, CheerpJ-based Applet Runner, a browser extension to run Java Applets, has received over 130,000 downloads, primarily from students and teachers needing access to educational content.

This large-scale use on real-world applications has also highlighted limitations and issues with CheerpJ that we tried to tackle in this new release.

Almost all developers using CheerpJ 2.x lamented poor usability, almost always in relation to the AOT compilation step, and the need for a native toolchain to pre-compile the JAR files. The new CheerpJ 3.0 architecture takes a radical departure from this, eliminating the AOT step altogether, and allowing a trivial integration in the vast majority of use cases, akin to using any JavaScript library. We also invested in the development of a new browser extension to run unmodified JNLP / Java Web Start applications, to cover even more use cases with a no-code solution. This new extension is currently being released to Enterprise customers, and will be released on the Chrome and Edge Web Stores within a few months.

Seemingly second-order technical limitations in CheerpJ 2.x, such as only partial support for Classloaders, incomplete support for Networking, and a poor implementation of Clipboard integration, resulted in the tool being unusable on some significant use cases, including in the Oracle domain. CheerpJ 3.0 removes all these limitations. 

Naturally, CheerpJ 2.x only supporting Java 8 by design has limited its applicability as a tool for modern web development. The CheerpJ 3 architecture allows for multiple Java language versions and multiple runtime environments to be supported, paving the way for modern Java versions to be supported in the short term.

The future of CheerpJ

We have great plans for CheerpJ beyond this release. With 3.0 having reached general availability, we are immediately launching an effort to gradually support more recent LTS versions of Java, starting from Java 11, and eventually reaching parity with the latest LTS release. This is only possible thanks to this new architecture, designed from the ground up to support multiple versions of the Java bytecode, and multiple JREs.

In adding support for more and more recent versions of Java, we intend CheerpJ to also become a modern web development tool, leveraging WebAssembly to enable a full Java environment on the browser. We envisage this to be particularly useful in the context of using Java libraries as part of Web Applications (imagine Apache POI running in-browser), or in web-enabling modern stand-alone Java applications.

Conclusions

This release is the culmination of a two-year long rewrite, and of 7 years of CheerpJ being used on large-scale applications by Business users and members of our community.

We are extremely grateful to our customers, who provided invaluable feedback on the tool in these past years, and greatly helped in its improvement. Our recently launched developer community, hosted on our Discord server, has been extraordinarily active, and we would like to thank all developers who tested and provided feedback on early versions and release candidates of CheerpJ 3.0.

If you want to learn more about CheerpJ 3.0, or try it out on your project, head over to our main website, Developer hub, and Developer community.

You might also like
Tags: CheerpJ, CheerpJ 3.0, Enterprise Java Applications, Java, Java Web Start, Oracle Forms, Release

More Similar Posts