Java

Java Architecture

Unravel the magic behind Java! Understand JDK, JRE, JVM, and how Java execution works.

By TechCoder TeamLast updated: 2026-06-02
In a Nutshell

Unravel the magic behind Java! Understand JDK, JRE, JVM, and how Java execution works. This hands-on tutorial focuses on practical implementation of java architecture concepts.

Java Architecture

To become a Java pro, you need to understand the "Holy Trinity" of Java: JDK, JRE, and JVM.

The Trio: JDK, JRE, and JVM

Here is how they stack up:

  • JDK (Java Development Kit): The full kit for developers. Contains JRE + Development Tools (Compiler javac, Debugger, etc.).
  • JRE (Java Runtime Environment): The environment to run Java applications. Contains JVM + Libraries.
  • JVM (Java Virtual Machine): The heart of Java. It executes the code.

1. JVM (Java Virtual Machine)

The JVM is an abstract machine. It doesn't physically exist but is an implementation that provides a runtime environment for the bytecode.

  • Loads Code: Classloader loads .class files.
  • Verifies Code: Bytecode Verifier ensures security.
  • Executes Code: Interpreter or JIT Compiler runs the code.

Class Loading Mechanism

The ClassLoader subsystem is responsible for loading class files. It follows the Delegation Hierarchy:

  1. Bootstrap ClassLoader: Loads core Java libraries (rt.jar, java.lang.*).
  2. Extension ClassLoader: Loads extensions (lib/ext).
  3. Application ClassLoader: Loads your code from the CLASSPATH.

2. Bytecode & Execution Flow

How does your code go from text to running program?

  1. Source Code (.java): You write readable code.
  2. Compilation (javac): The compiler converts source code into Bytecode (.class).
  3. Execution (java): The JVM reads the bytecode and translates it into machine code for the specific hardware.

[!NOTE] Bytecode is the secret sauce! It's universal language for JVMs. This implies you can compile on Windows and run on Linux without changing the bytecode.

JIT Compiler (Just-In-Time)

The default interpreter can be slow because it interprets line-by-line. The JIT Compiler boosts performance by compiling frequently used bytecode into native machine code at runtime.

Memory Areas in JVM

  • Heap: Where objects are stored.
  • Stack: Where method calls and local variables live.
  • Method Area: Stores class structures (metadata).

AI Mentor

Confused about "Java Architecture: Difference between JDK, JRE, JVM"? Ask our AI mentor for a simplified explanation.

Quiz

Quiz

Question 1 of 5

Which component is required to WRITE and COMPILE Java programs?

JRE
JVM
JDK
JIT

Next Steps

Now that we know the theory, let's setup our environment and write our first program!