The main difference between JDK and JRE is that the JDK provides the environment to develop and run Java programs while the JRE only provides the environment to run Java programs.
Java is a high-level programming language that was originally developed by Sun Microsystems. It is used to build various applications such as enterprise applications, and mobile applications. Java provides multiple advantages. It supports Object Oriented Programming and helps to develop secure and robust applications. JDK and JRE are related to Java application development. JDK is the software development environment used to develop Java applications. It consists of JRE and the other development tools. On the other hand, JRE provides a runtime environment and consists of JVM, class libraries and other files.
Key Areas Covered
Java, JDK, JRE, JVM
What is JVM
A Java program is a set of instructions written using the Java programming language that directs the computer to perform a specific task. It is also known as the source code. When the programmer writes the Java program and compiles it, the Java compiler converts the Java program into an intermediate code called the bytecode. The JVM stands for Java Virtual Machine. It is an abstract machine that converts the bytecode into machine code.
The source code is not understandable by the CPU. It is only understandable by the programmer. Therefore, the source code is converted into a machine readable and understandable machine code. Therefore, the CPU will execute the task according to the given instructions of the program.
If the Java program is directly converted into the machine code, it will not be possible to run that code in other platforms. When converting the Java code to the bytecode, it is not written for the physical machine. It is written for JVM. Therefore, the bytecode is platform independent. This makes Java language platform independent.
What is JRE
JRE stands for Java Runtime Environment. JRE is the combination of JVM, Java class libraries and other files required to run Java applications. It is a superset of JVM. When the programmer installs JRE, it is only possible to execute the Java program. It is not possible to develop the program. Therefore, the JRE is only used to run Java programs.
What is JDK
JDK stands for Java Development Kit. It helps to develop Java-based applications. When the programmer installs JDK, it is not required to download JRE separately because JRE is installed already with JDK. JDK is an implementation of Java platforms such as Standard Edition, Enterprise Edition and Micro Edition released by the Oracle Corporation.
JDK consist of the JRE and other development tools. These development tools include compiler (javac), an archiver(jar), a documentation generator (javadoc) etc. These tools help to complete the development of the Java application.
Relationship Between JDK and JRE
- JDK is the combination of JRE and other development tools.
Difference Between JDK and JRE
JDK is a software development environment used for developing Java applications on Java platforms such as Standard Edition, Enterprise Edition, and Micro Edition. JRE is a part of JDK that provides the minimum requirement to execute Java applications. This is the basic difference between JDK and JRE.
While JDK allows developing and running Java programs, JRE is only a part of it that allows running Java programs.
JDK consist of JRE and other development tools. JRE consist of JVM, class libraries and other supporting files.
The difference between JDK and JRE is that JDK provides the environment to develop and run Java programs while JRE only provides the environment to run Java programs. In brief, JDK is the combination of JDE and development tools while JRE is the combination of JVM and library files.
1. “Java JDK, JRE and JVM.” Java If, If…else Statement (With Examples), Available here.