Difference between JDK, JRE and JVM

Difference between JDK, JRE and JVM

JDK :
Java Developer Kit -- the JDK is what you need to compile Java source code
which contains tools needed to develop the Java programs.
You need JDK, if at all you want to write your own programs, and to compile them.
JDK is mainly targeted for java development.

JRE :
Java Runtime Environment -- is what you need to run a java program -- it contains a JVM, among other things.
JRE contains JVM, class libraries, and other supporting files. JRE is targeted for execution of Java files.

JVM: 
Java Virtual Machine -- the JVM actually runs Java bytecode.
The JVM interprets the byte code into the machine code depending upon the underlying operating system and hardware combination. It is responsible for all the things like garbage collection, array bounds checking, etc… Java Virtual Machine provides a platform-independent way of executing code.

We can differentiate as in below picture.  

    On above image of you can better understand relation between JDK, JRE and JVM