Friday, April 1, 2011

What is the difference between JDK, JRE and JVM ?

Though looks simple to begin with, you wouldn't believe that more than 30% of the people are able to get this one correctly. I simply ask the question that "How would you explain the difference between JDK, JRE and JVM to me." ?

The crisp answer which I would typically expect is
  • JDK(Java Development Kit) - Contains the JRE and various set of tools used to Compile a Java application (i.e. compiling a .java file to a .class file)

  • JRE (Java Runtime Environment) - In the minimum would contain the Java Interpreter, Java API libraries and Java browser plugin. It is required for the execution of Java Programs

  • JVM (Java Virtual Machine) - Is a part of JDK (and hence the JRE) which is used for interpreting the .class file to the target machine language code(of the target machine on which the VM is installed i.e. Windows, Linux, Mac etc.) and executes the same.

1 comment: