JDK, JRE and JVM
The basic concepts of the Java programming language are JDK, JRE, and JVM. These ideas are not applied to programming. However, as Java developers, we have to be aware of them.
JVM
The core of the Java programming language is JVM. The Java Virtual Machine (JVM) is in responsible for translating byte code into machine-specific code when we run a Java program. Additionally platform-dependent, JVM offers essential Java features like memory management, garbage collection, security, and more. Java options allow us to configure the JVM, which is customized. For instance, giving JVM the minimum and maximum amount of RAM. Because it offers an interface independent of the underlying operating system and hardware of the machine, JVM is known as virtual. Java programs can be written once and run anywhere due to their independence from both hardware and operating systems.
JRE
JRE is the implementation of JVM. It provides a platform to execute java programs. JRE stands for Java Runtime Environment. It consist a set of libraries + other files that JVM uses at runtime. If you just want to execute a java program, you can install only JRE. You don’t need JDK because there is no development or compilation of java source code is required.
JDK
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.).JDK is primarily used for code execution and has prime functionality of development.
JDK is platform dependentJDK = Java Runtime Environment (JRE) + Development tools
JDK vs JRE vs JVM
Let’s look at some of the important differences between JDK, JRE, and JVM.
- JDK is for development purpose whereas JRE is for running the java programs.
- JDK and JRE both contains JVM so that we can run our java program.
- JVM is the heart of java programming language and provides platform independence.