Monday 29 September 2014

What is the difference between JDK, JRE, JVM


This question is very common in all java interviews. Basically it checks the candidates knowledge of how java works. This question can be extended in further questions like java class loader and how class files are loaded in java etc. but for that firstly we should know that what these three terms actually means

JDK : -
JDK means Java Development Kit. JDK contains Java Run-time Environment (JRE) , Compilers and debuggers required to develop applets and applications.

JRE :-
JRE is subset of JDK, It contains Java Virtual Machine (JVM) along with Java Class Libraries which implement the Java application programming interface (API) form the Java Runtime Environment (JRE).

JVM : -
Java Compilers compile JAVA source code and create a .class file having the byte code. Java Virtual Machine(JVM) interpreters Java byte code and send necessary commands to underlying hardware or Just in time compiled to native machine code and execute it directly on the underlying hardware . If we have already compiled code of java (.class files) then we just only needs the JVM to interpreters .class file codes.

No comments:

Post a Comment