Swipe
SwipeSwipe
Swipe Apps

Paths

Motivation

Information

How Java Works · Lesson 10 of 28

Java Runtime Environment (JRE)

A free lesson from Swipe Coding · Java, level 1 · updated October 2026

By the Swipe team, founded by Colin · how we make lessons

🤖
Not everyone who runs Java wants to write it too. 🎬

Not everyone who uses Java wants to write their own code, too. Imagine you simply download a finished Java program to use it — for that, you don't need anything for compiling. That's what the "Java Runtime Environment", or JRE for short, is for.

The JRE contains the JVM along with the libraries needed to run Java programs — but no compiler. With the JRE you can execute finished bytecode (.class files), but you cannot compile your own source code.

java Main   // works with the JRE — executes bytecode
javac Main.java   // does NOT work with the JRE alone — no compiler included
The JRE is enough to run a program (java), but not to compile one (javac).
Quick check

What is missing from the JRE (Java Runtime Environment) compared to the JDK?

🤖
This analogy makes the JDK vs JRE split click instantly. 📀

You can think of the JRE like a DVD player: it can play finished movies, but it can't produce movies. The JDK, on the other hand, would be the entire film studio — including cameras, editing software, and the player to watch the final result.

True or false

With the JRE alone, you can compile your own Java source code into bytecode.

🤖
One more distinction before we wrap up this whole pipeline. 🔗

So if you only want to use Java software (for example, to start a program), the JRE is enough. If you want to develop your own Java programs, you need the full JDK — the JRE is automatically included with it, since without the JVM you couldn't even test your program.

Fill in the blank

The ____ contains the JVM and the libraries for running Java programs, but no compiler.

In summary, you now know the whole pipeline: you write source code (.java). The compiler from the JDK translates it into bytecode (.class). The JVM — included in both the JDK and the JRE — executes this bytecode. Developers install the JDK; people who just use Java software often only need the JRE.

Chapter quiz

How Java Works

10 questions · pass with 60% — just like in the app.

Fill in the blank

Human-readable Java text is stored in a file with the extension ____.

True or false

A processor can execute Java source code directly, without translating it.

Quick check

What is the tool called that translates Java source code?

True or false

If the compiler finds an error in the source code, it still produces a runnable file.

Fill in the blank

The compiler translates source code into ____, stored in a .class file.

True or false

Bytecode is platform-independent and works with any matching JVM.

Quick check

What does the JVM (Java Virtual Machine) do?

Fill in the blank

Developers install the ____ in order to write and compile Java programs.

Quick check

What is NOT included in the JRE (Java Runtime Environment)?

True or false

The order of the Java pipeline is: write source code, translate it into bytecode with the compiler, execute it with the JVM.

Keep your streak going in Swipe Coding

Swipe through every level of Java on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.

Get the Swipe apps →