What is Java written in?

The Java compiler (javac) is written in Java — making it partially self-hosting. The HotSpot JVM, the primary Java runtime, is written in C and C++. The Java standard library (java.lang, java.util, etc.) is written in Java itself.

Details

Java has two distinct implementations to consider: the compiler and the runtime.

The javac compiler is written in Java. It compiles Java source files to JVM bytecode. Because javac is itself written in Java, it must be bootstrapped using a previous version of the compiler.

The HotSpot JVM — the virtual machine that interprets or JIT-compiles bytecode at runtime — is written in C and C++. HotSpot includes the garbage collector, JIT compiler, class loader, and interpreter, all implemented in C/C++.

Explore in the Graph

See implementation and influence relationships interactively.

Open Interactive Graph →

Related Pages