What Java is: JDK, JVM & bytecode
Write once, run anywhere — how Java code becomes a running program.
Write once, run anywhere
Java source code is compiled, but not straight to machine code. The compiler (javac) turns your .java files into bytecode (.class files) — a portable instruction set. The JVM (Java Virtual Machine) then runs that bytecode on any operating system. That's the whole "write once, run anywhere" promise: one set of bytecode, many platforms.
Three acronyms you'll see constantly:
- JVM — the Java Virtual Machine. Runs bytecode.
- JRE — the JVM plus the standard libraries needed to *run* programs.
- JDK — the JRE plus the developer tools (javac, the debugger, etc.) needed to *build* programs.
If you're writing Java, you install the JDK. Modern Java is released on a six-month cadence, with a Long-Term Support (LTS) release every couple of years — Java 17 and Java 21 are the current LTS versions, and what this course targets.