← Back to Week 1 Hub

Java Compilation Flow

Workbook 1c, p.37 — From Source Code to Running Program

Step 1
📄
.java
Source Code
Step 2
javac
Java Compiler
Step 3
📦
.class
Bytecode
Step 4
JVM
Virtual Machine
Step 5
🎬
Output
Program Runs!
👉

Click a step or press Play

Click on any step in the pipeline above to see a detailed explanation, or press the Play button to watch the entire compilation flow animate step by step.
🌎 “Write Once, Run Anywhere”
💻
Windows
✔ Same .class runs here
🍏
macOS
✔ Same .class runs here
🐧
Linux
✔ Same .class runs here

💡 Key Insight

Java is both compiled AND interpreted. The compiler (javac) turns your code into bytecode. The JVM then interprets that bytecode into machine code for whatever OS you're on.

🚀 IntelliJ Tip

In IntelliJ, clicking the green Run button does steps 2–5 automatically! It compiles your .java file and runs the output in one click — no terminal commands needed.

← Bytes & Storage Scale JDK / JRE / JVM Layers →