Tech News
← Back to articles

Applets Are Officially Gone, but Java in the Browser Is Better

read original related products more articles

Applets Are Officially Gone, But Java In The Browser Is Better Than Ever

Summary

Applet History

blink

marquee

Java developers made games, 3D molecule renderings, business applications, and more. While download speeds and processor speeds in the late 90's placed some limits on what could be done, the creativity shown was remarkable. And for developers, the deployment model for their code was very enticing: post your applet on a web page, and anyone on the planet could run it instantly, as long as they had the Java plug-in installed (which, at the time, was very likely).

In the 2000's, politics interfered and browser vendors removed plug-in support, instead preferring their own walled gardens and restricted sandboxes, which often lag behind industry standards for years. This undid years of innovation and broke large parts of the internet that depended on plug-ins.

TeaVM

TeaVM, at its heart, transpiles Java code into JavaScript (or, these days, WASM). However, in order for Java code to be useful for web apps, much more is required, and TeaVM delivers. It includes a minifier, to shrink the generated code and obfuscate the intent, to complicate reverse-engineering. It has a tree-shaker to eliminate unused methods and classes, keeping your app download compact. It packages your code into a single file for easy distribution and inclusion in your HTML page. It also includes wrappers for all popular browser APIs, so you can invoke them from your Java code easily, with full IDE assistance and auto-correct.

TeaVM is revolutionary in its approach and performance. It is a remarkable achievement that opens doors to Java developers. For certain apps, especially games, that primarily render on a canvas , it can be all you need. However, for many web apps, you find you want to build pages out of HTML. You want to build and reuse components. You want binding to reduce boilerplate for populating form elements and reacting to events. You want to communicate with Java services painlessly. For these things, you need Flavour, built on top of TeaVM.

... continue reading