Before moving advanced topics we should learn about JRE, JDK, and JVM. We will discuss the difference between jdk jre and jvm? and what is jdk jre jvm?. The JDK(Java Development Kit) is a software development environment. That includes the JRE(Java Runtime Environment) and JVM(Java Virtual Machine) and some other tools that are used to develop for Java application or applet. So let’s discuss them one by one.
JDK (Java development kit)
Java development toolkit is a software development environment used for developing java applications and applets. The JDK allows developers to create Java programs that will be executed and run by the JVM and JRE. JDK is a package of tools that provides an environment for developing Java-based software. It physically exists. It contains JRE and development tools.
JDK includes the JVM (Java virtual machine), JRE (Java Runtime Environment), and development tools such as compiler, debugger, interpreter/loader (Java), archive (jar), a documentation generator (Javadoc) etc.
JRE (Java Runtime Environment)
JRE stands for Java Runtime Environment and also known as Java RTE. The Java Runtime Environment is a set of software tools that provides the minimum requirements for executing a Java application. It includes the Java Virtual Machine (JVM), core classes, and supporting files. It physically exists.
JVM (Java virtual machine)
As we know java is a high-level programming language. Our system/machine can understand only machine level language. So, the machine can’t run the program of java directly because it’s written in a high-level language. It needs to be translated into that machine language.
The java compiler translates the source code (High-level language) to byte code (Not a machine-level language). Now JVM (full form Java virtual machine) translates the byte code to machine-level language. JVM (Java Virtual Machine) is a virtual machine it doesn’t physically exist. It resides in the real machine (your computer) and provides a run time environment in which Java bytecode can be executed. It can also run native language programs (Those programs which are written in other languages like C and C++) and compiled to Java bytecode. The compiler compiles .java files and creates .class files that contain the byte codes. Now JVM translates the byte code that will run by an interpreter. You can read the JVM from here.