Java – JDK, JRE and JVM

  • Post category:Java
  • Reading time:5 mins read

JVM

JVM stands for Java Virtual Machine, which is an abstract machine and is called a virtual machine because it does not physically exist. It is a specification that provides a runtime environment that can execute the Java bytecode. You can also run programs written in other languages ​​and compiled into Java bytecode.

The JVM can be used on many hardware and software platforms. JVM, JRE and JDK depend on the platform, since each operating system has its own configuration. However, Java is platform independent. The JVM has three concepts: specification, implementation, and instance.

JVM performs the following tasks:

  • Loads code
  • Verifies code
  • Executes code
  • Provides runtime environment

JRE

JRE stands for Java Runtime Environment. This is also written Java RTE. This is an implementation of JVM which is physically present. This is used to provide a runtime environment. Java Runtime is a set of software tools used to develop Java applications. The JVM implementation was also actively launched by companies other than Sun Microsystems. It contains a set of Libraries + other supportive files that JVM uses at runtime.

JRE_implementation

JDK

JDK is the Java Development Kit and It is a software development environment used to develop Java applications and applets. It exists physically. Includes Java Runtime Environment (JRE) and other development tools used to develop Java applications. The JDK includes its own Java virtual machine (JVM) and some other resources like interpreter / loader (java), compiler (javac), archive files (jar), documented generator (Javadoc).

JDK is an implementation of either one of the Java Platform, Standard Edition, Java Platform, Enterprise Edition, or Java Platform, Micro Edition platforms launched by Oracle Corporation as a binary product.

JDK_implementation

Comparison between JDK,JRE and JVM

PointPropertyJDKJREJVM
1RoleJDK (Java Development Kit) is a software development kit which is used to develop applications . JRE, JDK also contains number of development tools (compilers, interpreter / loader,JavaDoc, Java Debugger etc.).JRE (Java Runtime Environment) is the implementation of JVM and it provides class libraries and other files, along with JVM, JVM (Java Virtual Machine) is an abstract machine that is platform-dependent.It is a specification that provides a runtime environment that can execute the Java bytecode. JVM has three concepts: specification, implementation, and instance.
2Main PurposeJDK is used for code execution and The main purpose is used for develop java application. JRE is majorly responsible for creating environment for code execution.JVM specifies all the implementations and responsible to provide these implementations to JRE.
3Platform IndependenceJDK is platform dependent Like of JDK. JRE is also platform dependent.JVM is platform independent.
4Supportive ToolsAs JDK is responsible for prime development so it contains development tools for developing, debugging and monitoring java application.JRE does not contain tools such as compiler or debugger etc. It contains class libraries and other supporting files that JVM requires to run the program.JVM does not include software development tools.
5ImplementationJDK = JRE+ Development toolsJRE = JVM + Libraries to run the applicationJVM = Only Runtime environment for executing the Java byte code.