Tuesday, 23 June 2015

Difference between JDK, JRE and JVM


JVM:-
The Java Virtual machine (JVM) is the virtual machine that runs the Java bytecodes. The JVM doesn't understand Java typo, that's why you compile your *.java files to obtain *.class files that contain the bytecodes understandable by the JVM.
Java Virtual Machine 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… JVM is platform dependent.

JRE:-
Java Runtime Environment contains JVM, class libraries, and other supporting files. It contains set of libraries plus other files that JVM uses at runtime.
Actually JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE. If you want to run any java program, you need to have JRE installed in the system.
It does not contain any development tools such as compiler, debugger, etc.
The JRE does not contain tools and utilities such as compilers or debuggers for developing applets and applications.

JDK:-Java Development Kit (JDK) The JDK is a superset of the JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developing applets and applications.


                                    JDK is a superset of the JRE






                                             Relations between JVM ,JRE, JDK