To be precise, applets were an early application of Java. But Sun Microsystems actually developed it in the long-standing dream of the “universal binary.”
The project began in 1991 targeting set-top boxes. [source](https://web.archive.org/web/20100210225651/http://www.java.c...)
WASM is another iteration of the same noble idea done with different technologies at a different moment.
Java and the JVM have been incredibly successful. WASM has the potential to bring the dream of a universal binary even farther.