Difference Between JDK, JRE and JVM

JVM (Java Virtual Machine) is an abstract machine.It is a specification that provides runtime environment in which java bytecode can be executed.And JVM is plateform dependent.

The JVM performs this main tasks:

  1. Loads code
  2. Verifies code
  3. Executes code
  4. Provides runtime environment

JRE

JRE(Java Runtime Environment) It is used to provide runtime environment.It is the implementation of JVM. Implementation of JVMs are also actively released by other companies besides Sun Micro Systems.

JDK

The "JDK" is the Java Development Kit. I.e., the JDK is bundle of software that you can use to develop Java based software. The "JRE" is the Java Runtime Environment. I.e., the JRE is an implementation of the Java Virtual Machine which actually executes Java programs. Typically, each JDK contains one (or more) JRE's along with the various development tools like the Java source compilers, bundling and deployment tools, debuggers, development libraries, etc.