CheerpJ Java-to-JavaScript compiler boosts exception handling, native methods

Matthew N. Henry

Version 2.1 of the CheerpJ Java-to-WebAssembly-and-JavaScript compiler, released April 6, brings optimizations to exception handling and native methods.

Described as a maintenance release, CheerpJ 2.1 introduces optimizations for exception handling, which are now compiled to “much more efficient” JavaScript code, according to a bulletin on the version 2.1 upgrade. In addition, native Java reflection calls have been optimized, thus lowering the overhead in comparison with standard Java calls. The build size of ahead-of-time JavaScript output has been reduced as well.

CheerpJ converts a Java client application into standard HTML, JavaScript, and WebAssembly, working from Java bytecode without requiring access to source code. CheerpJ 2.1 also features:

  • Improvements to the -stub-natives, a cheerpjfy.py option that creates stub JavaScript files for native methods, enabling development of browser-based implementations of native methods in JavaScript/WebAssembly.
  • Improvements to the robustness of the ahead-of-time compiler.
  • Improvements in Java-JavaScript interoperability.

CheerpJ added WebAsssembly support with release 2.0, which arrived in February.  CheerpJ 2.1 is available for Windows, MacOS, and Linux at Ieaningtech.com. Developed and supported by Leaning Technologies, CheerpJ works on Java Swing clients, Java applets, and Java libraries.

Copyright © 2020 IDG Communications, Inc.

Next Post

How to Whirl a Squirrel off of a Bird Feeder

Squirrels are all right. They’re better than your average rodent, and they jump around and stuff. But if you have a bird feeder, you might hate them. These animals just don’t get that some food is set aside for birds. They don’t respect boundaries, and they’re not above wrecking your […]