JDK vs JRE vs JVM
write JDK vs JRE vs JVM
1. JDK (Java Development Kit)
JDK stands for Java Development Kit. It includes all the tools, executables, and libraries required to develop, compile, debug, and run Java programs. JDK is platform dependent, meaning different versions are available for Windows, Mac, and Unix systems. It contains both JRE and JVM and is responsible for the complete development and execution process of Java programs.
2. JRE (Java Runtime Environment)
JRE stands for Java Runtime Environment. It provides the environment required to run Java programs. It includes the implementation of JVM along with core libraries and other components needed for program execution. JRE mainly consists of Java binaries, class libraries, deployment technologies, and user interface libraries that support runtime execution.
3. JVM (Java Virtual Machine)
JVM stands for Java Virtual Machine. It is a specification that provides a runtime environment for executing Java bytecode. JVM is responsible for loading code, verifying code, and executing code. It converts bytecode into machine-specific instructions so that the program can run on any operating system. JVM also ensures memory management and provides a secure runtime environment for Java applications.
Difference between JDK, JRE, and JVM
Β
| Sr. No. | Key | JDK | JRE | JVM |
|---|---|---|---|---|
| 1 | Definition | JDK (Java Development Kit) is a software development kit to develop applications in Java. In addition to JRE, JDK also contains number of development tools (compilers, JavaDoc, Java Debugger etc.). | JRE (Java Runtime Environment) is the implementation of JVM and is defined as a software package that provides Java class libraries, along with Java Virtual Machine (JVM), and other components to run applications written in Java programming. | JVM (Java Virtual Machine) is an abstract machine that is platform-dependent and has three notions as a specification, a document that describes requirement of JVM implementation, implementation, a computer program that meets JVM requirements, and instance, an implementation that executes Java byte code provides a runtime environment for executing Java byte code. |
| 2 | Prime functionality | JDK is primarily used for code execution and has prime functionality of development. | On other hand JRE is majorly responsible for creating environment for code execution. | JVM on other hand specifies all the implementations and responsible to provide these implementations to JRE. |
| 3 | Platform Independence | JDK is platform dependent i.e for different platforms different JDK required. | Like of JDK JRE is also platform dependent. | JVM is platform independent. |
| 4 | Tools | As JDK is responsible for prime development so it contains tools for developing, debugging and monitoring java application. | On other hand JRE does not contain tools such as compiler or debugger etc. Rather it contains class libraries and other supporting files that JVM requires to run the program. | JVM does not include software development tools. |
| 5 | Implementation | JDK = Java Runtime Environment (JRE) + Development tools | JRE = Java Virtual Machine (JVM) + Libraries to run the application | JVM = Only Runtime environment for executing the Java byte code. |