1/9/15

JDK vs JRE vs JVM

It is often asked that what is difference between JDK, JRE and JVM. So i am describing some key differences in basic understanding


JVM


Minimum required component to run any program. Java Virtual Machine is a virtual runtime environment inside OS environment to execute the Java program as well as to provide it security.
You can not compile your java classes with it.

JRE 


We also need some pre compiled utility classes that we may have used in our program. So
JRE = JVM + Java API.
It can not compile your java classes either.

JDK


It is Java Development Kit used to support Java development. It has JRE as component and on top of that JDK has compiler and Java source code for standard classes.

JDK = JRE + Compiler + Java Source Code

This can be seen as:-
JDK > JRE > JVM

Thanks.