skip to content
everything.start.whatIsJava

what java actually is

the language, the JDK, the JVM, and why they're three different things.

chapter
chapter 01.01
reading time
8 min read

"java" is three things wearing one name: the language (what you type), the JVM (a program that runs compiled java on any machine) and the JDK (the JVM plus the tools to build programs for it).

you write .java, javac turns it into bytecode, and the JVM runs that bytecode on whatever OS it's sitting on.

the picture

"install java". "java is slow". "we're still on java 17". three sentences, three different things called java. kinda confusing, so let's pull them apart.

think of sheet music. you compose a song (java source). a transcriber writes it down as sheet music (javac → bytecode). any musician who can read sheet music can play it, on whatever instrument they have (a JVM, on whatever OS). the sheet music never changes between performances. the musician does.

layer =
JDKjavacjshelljarjavadocjdbjavapjlinkjpackagejcmdjfr+20 more
runtime (the old "JRE")java.basejava.net.httpjava.sqljava.xmljava.loggingjava.desktop+63 more modules
JVMclass loaderverifierinterpreterJIT (C1, C2)garbage collectorthreads
JVM · java virtual machine

one native program (libjvm) that loads .class files, checks them, runs the bytecode in an interpreter, compiles the hot parts to machine code with the JIT, and cleans up dead objects with the GC.

for the thing doing the work19 MB of native code
click a layer, or pick one above. the JDK contains the runtime, which contains the JVM. the sizes are real: temurin 25 on an arm mac.
java
the language: what class, int and for mean. written down in the java language specification (the JLS).
JVM
java virtual machine. an actual program (mostly C++) that runs bytecode. it has its own spec, the JVMS, and it has never seen a line of java syntax.
JDK
java development kit. the JVM, the standard library and the tools (javac, jshell, jar...). this is what you install.
JRE
java runtime environment: the JDK without the dev tools. oracle stopped shipping a separate one with java 11 (some vendors still build them). today you install a JDK, or ship a trimmed runtime made with jlink.
OpenJDK
the open-source project where the JDK is built. temurin, corretto, oracle's JDK: all builds of the same code. which one to pick is in getting a JDK.

write once, run anywhere

here's the trick. javac does not compile your code to x86 or arm machine code. it compiles to bytecode, the instruction set of a CPU that doesn't exist. then every OS gets its own JVM, which knows how to run that made-up CPU on the real one underneath.

run on =
Main.javajavac
Main.ktkotlinc
Main.scalascalac
core.cljclojure
Main.class414 bytes
ca fe ba be 00 00 00 45 00 1d 0a 00 02 00 03 07 …
bytecode. not x86, not arm. the same bytes everywhere.

a mac JDK has a libjvm.dylib built for apple silicon. the .class didn't change. only the JVM did.

pick an OS. the .class file is byte-for-byte identical; the JVM is the part you download per platform. kotlin, scala and clojure live here too: their compilers emit the same bytecode, so the JVM can't tell the difference.

you can see the bytecode's fingerprint yourself. every class file on earth starts with the same four bytes:

terminal
$ javac Main.java
$ xxd Main.class | head -1
00000000: cafe babe 0000 0045 001d 0a00 0200 0307  .......E........

CAFEBABE is the magic number (an old joke from the people who designed the format). 0x45 is 69, the class file version for java 25. we'll take one apart in compile and run.

compiled or interpreted? both

people argue about this one. the honest answer is that java gets compiled twice.

hover a stage.

hover a stage. javac runs once, on your machine. everything right of the .class happens every time the program runs, on the machine running it.

that second compile is why java programs speed up after a few seconds of running (people call it warm-up), and why "java is slow" is mostly a story about startup. once the JIT has had a look, hot code runs as native machine code, sometimes better tuned than what a C compiler would guess ahead of time, because the JIT knows what your program actually does. the full story is in the interpreter and the JIT.

quick check
you compile Main.java on a mac. your friend has a windows laptop with java 25 installed. what do they need to run your Main.class?

one language, many versions

a new java ships every march and every september, like a train that leaves on schedule whether your feature is on it or not. every two years, one release is LTS (long-term support): vendors keep patching it for years, so that's what most companies run. 17, 21 and now 25.

2014201620182020202220242026
java 25
sep 2025LTSthis site
  • →void main() + IO.println
  • →flexible constructor bodies
  • →import module
  • →compact object headers
LTS
hover or tap a release (← → work too). the gap after 8 is real: 9 took three and a half years, so java switched to fixed six-month releases. this site targets java 25, the latest LTS.

old versions called themselves 1.something: java 8 is "1.8" and its java -version still prints 1.8.0_.... from 9 on it's just the number. every release in detail lives in java 8 → 27.

one level deeper:who actually owns java+

Sun Microsystems made it (James Gosling's team, 1.0 shipped in january 1996). Sun open-sourced the JDK as OpenJDK in 2006-2007, under the GPL with the "classpath exception", which is what lets you ship closed-source programs on top of it. Oracle bought Sun in 2010 and still leads the project, but changes go through public proposals called JEPs (JDK enhancement proposals), and Red Hat, Amazon, Microsoft, Google, SAP and others work on the same code. "java" is an Oracle trademark, which is why every other vendor calls its build something else: temurin, corretto, zulu.

keylines
  • the language is what you type. the JVM is what runs it. the JDK is the box both come in.
  • javac compiles to bytecode, not machine code. the JVM's JIT makes machine code while your program runs.
  • one .class runs on every OS. the JVM is the part that's different per platform.
  • a new java every six months, an LTS every two years. learn on the latest LTS: 25.