Start Learning
Javaneer
Back to stage
Stage 0·Meet Java

The Java Ecosystem

JDK vs JRE vs JVM, bytecode, the compile-and-run pipeline, and the universe of libraries around Java.

14 min readBeginner
On this page

You've heard three acronyms that sound almost identical: JDK, JRE, and JVM. They confuse nearly every beginner. Let's make them crystal clear, then follow your code on its journey from text to a running program.

JDK vs. JRE vs. JVM

Think of these as three nested layers:

A kitchen, a stove, and a full cooking kit
  • The JVM is the stove - it actually cooks (runs) your program.
  • The JRE is the stove plus basic ingredients - everything needed to run a finished dish, but not to create new recipes.
  • The JDK is the complete cooking kit - the stove, ingredients, and all the tools (knives, measuring cups) to create new dishes.

To write Java, you need the full kit: the JDK.

Put plainly:

LayerContainsUse it to…
JVMThe engine that runs bytecodeExecute Java programs
JREJVM + core librariesRun Java apps (no compiling)
JDKJRE + compiler + dev toolsDevelop Java apps

Since you're learning to write Java, you'll install the JDK.

The journey: from source code to running program

Here's what actually happens when you run a Java program. It's a two-step trip.

Step 1 - Compile. You write human-readable source code in a .java file. The Java compiler (javac) translates it into bytecode, stored in a .class file. Bytecode isn't human code and isn't machine code - it's a compact, universal in-between.

// Hello.java  (source code you write)
public class Hello {
    public static void main(String[] args) {
        System.out.println("Hello, Java!");
    }
}
javac Hello.java   →   produces Hello.class  (bytecode)

Step 2 - Run. The JVM reads the bytecode and executes it on your specific machine (Windows, macOS, Linux…). Because every platform has its own JVM, the same bytecode runs everywhere unchanged.

java Hello   →   the JVM runs Hello.class   →   "Hello, Java!"
Bytecode is like sheet music

Sheet music isn't a sound - it's a universal notation. Give the same sheet to a pianist in Tokyo or a guitarist in Berlin, and each plays it on their own instrument. Bytecode is the sheet music; the JVM is the musician on each platform. Write the music once, and any JVM can play it.

This is 'Write Once, Run Anywhere' in action

Because your code compiles to portable bytecode - not to Windows- or Mac- specific instructions - a single compiled program runs on any device with a JVM. That portability is Java's superpower.

Java editions and the wider universe

"Java" is bigger than the language itself:

  • Java SE (Standard Edition) - the core platform you're learning: the language, the JVM, and essential libraries.
  • Jakarta EE (formerly Java EE) - enterprise extensions for large server applications (web APIs, messaging, transactions).
  • Java ME (Micro Edition) - a slimmed-down edition for constrained devices.

Around this core sits a vast ecosystem: build tools (Maven, Gradle), frameworks (Spring, Quarkus), testing tools (JUnit), and hundreds of thousands of open-source libraries. You'll meet many of these in later stages.

Quick check

You want to WRITE and compile Java programs. Which do you need to install?

Key takeaways

  • The JVM runs bytecode; the JRE adds core libraries to run apps; the JDK adds tools to develop apps.
  • To write Java, install the JDK.
  • Java source (.java) is compiled by javac into portable bytecode (.class).
  • The JVM executes that bytecode on any platform - enabling 'Write Once, Run Anywhere'.
  • Java SE is the core; Jakarta EE and Java ME extend it, surrounded by a huge library ecosystem.

Enough theory - let's get your machine ready and run your very first Java program in the next lesson.