EMZETT.
Login

JRE (Java Runtime Environment)

In short: The JRE is the runtime environment you need to run finished Java programs. It consists of the JVM and the standard libraries but contains no compiler.

In more detail: For development you need the larger JDK, which contains the JRE plus tools such as javac. Users who only want to launch a Java program used to need just the JRE.

In Depth

JDK  (develop)
 ├─ tools: javac, jar, javadoc, jdb, jlink ...
 └─ JRE  (run)
     ├─ standard library (java.base, java.sql ...)
     └─ JVM  (runs bytecode: interpreter + JIT + garbage collector)
  • JVM: The virtual machine that executes the bytecode.
  • JRE = JVM + class library. No compiler, no developer tools.
  • JDK = JRE + developer tools.
  • Since Java 11 Oracle offers no separate JRE download. The JDK is enough for both. With jlink you build a small custom runtime image that contains only the modules needed.
  • Checking the version: java -version shows the running runtime, javac -version the compiler’s.
  • Typical errors: “Unsupported class file major version” means the bytecode was produced by a newer JDK than the executing JRE knows. Then check JAVA_HOME and PATH.
  • Alternatives: OpenJDK builds from Eclipse Temurin, Amazon Corretto, Azul Zulu and others.

See also: JDK, JVM (Java Virtual Machine), javac (Java compiler)