Difference between JRE, JDK and JVM

Java Runtime Environment (JRE) is meant for users to run applets and Java program and it is also developed as browser plugin to run any Java program from browser like Internet Explorer, Mozilla Firefox or Google Chrome, you need JRE to be installed in your machine and should be enable on your browser as well.


Java Development Kit (JDK) is meant for programmers for developing applets and applications. It is a superset of JRE, and contains everything that is in the JRE, plus tools such as the compilers and debuggers necessary for developers for development and troubleshooting.


Java Virtual Machine (JVM) is a specification that provides runtime environment in which java byte code is converted into machine specific code and executed. JVM is at heart of Java programming language and provide several features to Java programmer including Memory Management and Garbage Collection, Security and others.

We have different JVM for Windows, Linux or Solaris, as the byte code needs to be converted into machine code, which is platform dependent. However one JAR can run on all these operating system, as the JAR would contain the java byte code which can be interpreted by JVM on any platform.

There are different JVM implementations, namely Client VM and Server VM. These may differs in things like performance, reliability, speed, etc. These implementations will differ in those areas where Java specification doesn’t mention how to implement the features, like how the garbage collection process works is JVM dependent, Java spec doesn’t define any specific way to do this system level service.

The client VM is tuned for reducing start-up time and memory footprint suitable for client environment whereas server VM is designed for maximum program execution speed that is intended for running long-running server applications where fastest possible operating speed is generally more important than having the fastest possible start-up time.

JVM automatically selects Server VM implementation on “server-class” systems, defined as “at least 2 CPUs and at least 2 GB of physical memory.” However, the JVM bundled with JRE for Microsoft Windows platforms includes only the Client VM.

In short here are few basic differences between JRE, JDK and JVM:

        1) JRE and JDK come as installer while JVM are bundled with them.
        2) JVM is created when you execute Java program by giving “java” command.
        3) JRE is for users, JDK is for developers and JVM provides runtime environment.

No comments :

Post a Comment