Repaso
EspaƱol
Java CoreCoreJV-01

What is the difference between the JDK, the JRE and the JVM?

Options

  1. They are three names for the same Java installation
  2. JVM runs bytecode; JRE adds libraries; JDK adds tools like javac (Correct option)
  3. JDK runs programs; JRE compiles them; JVM stores the results
  4. JVM is the compiler; JDK is the editor; JRE is the debugger

Answer

JVM runs bytecode; JRE = JVM + standard libraries; JDK = JRE + developer tools such as the compiler (javac)

Why

Java source code (.java) is first compiled into bytecode (.class files). Bytecode is not for your processor: it is for a program called the JVM (Java Virtual Machine), which reads it and runs it.

The JRE (Java Runtime Environment) is the JVM plus the standard class libraries, enough to RUN Java programs.

The JDK (Java Development Kit) is the JRE plus tools to BUILD programs: the compiler javac, jar, debuggers. As a developer you install the JDK.

Remember

JDK = build + run. JRE = run. JVM = the engine that executes bytecode.

Key terms

Practice this question in Repaso