Skip to content

Relationship between Java and JavaScript

Are Java and JavaScript really as unrelated to each other as India and Indonesia? Come to think of it, these two languages are more related than you might think.

Origins

In 1995, Netscape Navigator was considering Scheme as the language to put into its browser. If Scheme had been adopted, functional languages might well have become hugely popular. But instead of Scheme, the direction shifted toward including two engines: Java applets and a scripting language that was “similar to Java.” The result was a language called Mocha, with syntax similar to Java (I never got to see this one). Mocha soon changed its name to LiveScript, and finally to JavaScript. Because it was made to look like Java, even Java-only keywords such as int, float, synchronized, and transient remained reserved words in JavaScript for a while.

(The JavaScript trademark belonged to Sun Microsystems, which developed Java. Oracle acquired the trademark when it acquired Sun. As of 2026, a lawsuit and a petition seeking to invalidate the trademark and have it relinquished are underway. This is why the JavaScript standard is called ECMAScript.)

Libraries

JavaScript not only borrowed Java’s syntax, but also took over some APIs from JDK 1.0 almost as-is (for example, Java’s java.util.Date class. No comment). There was a time when Java ran well in browsers (Java applets, remember?), and through a technology called “LiveConnect,” bidirectional calls between Java and JavaScript were even possible.

Engine

Rhino, a JavaScript engine implemented in Java, has existed since as early as 1997, and before Node.js it was one of the reasonably decent solutions for running JavaScript on the server side. I learned about Rhino sometime around the mid-2000s, and I remember finding it useful from time to time. Before that, it seems JScript, Microsoft’s JS implementation, was (probably) the most stable platform for running server-side JavaScript. (Windows Scripting Host, remember? IIS, remember?) Rhino was later included by default via javax.script, before eventually being removed. GraalJS now fills a similar role.

There was apparently also a server-side JavaScript engine called LiveWire from Netscape as early as 1996, but I never used it.

Meanwhile, Lars Bak, who led the development of Java’s HotSpot VM, later joined Google and developed V8, Chrome’s JavaScript engine.

Conclusion

In various senses, the two languages are quite closely related to each other.

By
ak
Created
Updated

Machine-translated from the Korean original.

2026 © ak | markdown | 한국어