JDK, JVM and JRE are the terms in Java which are mostly mistaken to be the same by the people. People consider the three terms as the same because they are mostly used together in Java.
Therefore, to clear the confusion, the differences between the three have been depicted in this article. Firstly, the basic understanding about JDK, JVM and JRE will be developed so that it is easier to understand the differences later.
Also Read: Difference between Java Framework, Text Editor, and IDE
Java Development Kit (JDK)
Java Development Kit or JDK is the environment for software development used for developing applications and applets in Java. JRE is included in JDK. Java Development Kit (JDK) also includes a compiler (javac), an interpreter (java), a documentation generator (Javadoc), an archiver and almost all the tools used in Java Development (jar).
Java Development Kit (JDK) is used when Java applications and applets are required to be developed as well as run while JRE is used simply to run Java applications and applets. JDK is specific to the platform, therefore different installers are used to install JDK on different platforms such as Windows, Mac or Linux.
The latest version of Java Development Kit (JDK) is version 8 also called as Java 8. The new features of JDK 8 are:
- PermGen Error Removed
- Date and Time API
- Type Annotations
- Parallel operations
- Default Methods
- Pipelines and Streams
- TLS SNI
- Nashhorn JavaScript Engine
- Concurrent Accumulators
- Lambda Expressions
JDK is installed in the folder named JAVA_HOME. The location of binaries such as javac, java, etc. is JAVA_HOME/bin. Binaries ought to be in the system PATH for the purpose of compiling and executing Java programs.
Java Virtual Machine (JVM)
Java Virtual Machine is a virtual machine or an abstract computing machine that allows a computer to run a Java program. A JVM converts the Java bytecode into machine code that is understood by any machine, this is reason why there are different JVM’s for Linux, Windows, etc. present, but a single jar file. After downloading and installing JRE, all the code needed to create JVM is acquired.
Java Virtual Machine (JVM) provides several unique features to Java programming and is the heart of Java programming. Java Virtual Machine (JVM) provides automatic garbage collection, Security, Memory Management and several other system level features.
At the time of creation JVM can be customized i.e. the start of the memory or the maximum memory heap size can be specified. The feature of platform independence of Java is given by Java Virtual Machine (JVM) to Java programming language.
Java Runtime Environment (JRE)
Java Runtime Environment (JRE) is also referred to as Java runtime. Java Runtime Environment is a set of software tools required to run a Java based applications. It consists of Java Virtual Machine (JVM), supporting librariesand platform core classes. Java Runtime Environment (JRE) is a subset of Java Development Kit (JDK) and it is possible to download it separately.
To run a Java based Applet downloaded from Internet, the browser might suggest to download JRE. Numerous versions of JRE are available at java.oracle.com. Java Runtime Environment (JRE) is mostly downloaded by a user who wants to execute Java program inside browser or standalone downloads JRE. Java Runtime Environment (JRE) can possibly work with all browsers such asFirefox, Internet Explorer and Chrome.
The size of Java Runtime Environment (JRE) is less than Java Development Kit(JDK) so it needs less diskspace as compared to JDK. The reason to this is that JRE does not contain Java compiler and other software tools needed to develop Java based programs.
The main purpose of JRE is to run Java programs and that is why it used by the ones who wants run a Java program i.e. end users of your system.We are one of Best java training institute in Gurgaon who help students to learn core and advanced part of java with 100% Practical Exposure.
Difference Between JDK, JVM And JRE In Java Programming Language
The basic differences between JDK, JVM and JRE are depicted briefly.
- JDK is used to both develop and run Java application. JRE is used only torunan already compiled Java application. JVM provides the environment required to run Java application and the Java code library is required to run applications.
- JDK and JRE are in the form of an installer while JVM is bundled with them.
- JVM is mandatory with both JDK and JRE and when a Java program is executed by giving “java” command, it then JVM is created.
- JDK is used for the purpose of development while JRE is used for the purpose of running java based programs.
- JRE is JVM + Library classes.
JDK is JRE + Development tools.
JDK, JVM and JRE are used very often and forms the most important part of Java programming language. They are somewhat similar but not completely identical. Therefore, the difference between JDK, JVM and JRE is briefly described in the article.