JRE (Java Runtime Environment)

The Java Runtime Environment (JRE) is the minimum installation needed to run a Java program. It contains the JVM and the Java standard class library, but not the compiler or developer tools.

Contents

  • The JVM (java)
  • The standard class library (java.lang, java.util, java.io, java.net, etc.)
  • Configuration files and security policies

When do you need only a JRE?

When you run pre-compiled Java applications: Minecraft, DBeaver, JMeter, a Spring Boot JAR. Production servers that only need to execute a JAR can use a JRE-only image to save ~100 MB.

JRE status in modern Java

Since Java 11, most OpenJDK vendors stopped producing a separate JRE and ship only the full JDK. Oracle used to ship a consumer JRE on Windows/Mac — this is now deprecated. For container images, several vendors offer JRE-only variants (e.g. eclipse-temurin:21-jre) specifically to keep image size small.

Slim runtime with jlink

# Build a custom, minimal runtime image containing only the modules your app uses:
jlink --add-modules java.base,java.logging --output slim-jre
./slim-jre/bin/java -version
# Result: a ~50 MB runtime instead of 200+ MB