Differences between JDK, JRE AND JVM
Differences between JDK,JRE and JVM .
A software development environment called Java Development Kit (JDK) is used to create Java programs and applets. The Java Runtime Environment (JRE), a Java interpreter/loader, a Java compiler, a Java archiver (jar), a Javadoc documentation generator, and other tools are essential for Java development are all included.
- JDK is an acronym for Java Development Kit, a software package employed for creating a java based apps and applets.
- It is an overall package that is used to both develop and run a program in java.
- In addition with JVM and JRE it also contains Java source compilers, Java debuggers, bundling and deployment tools.
- Developers new to Java often confuse the Java Development Kit and the Java Runtime Environment. The distinction is that the JDK is a package of tools for developing Java-based software, whereas the JRE is a package of tools for running Java code.
The JDK has as its primary components a collection of programming tools, including:
- appletviewer – this tool can be used to run and debug Java applets without a web browser
- apt – the annotation-processing tool.
- extcheck – a utility that detects JAR file conflicts
- idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file.
Experimental tools may not be available in future versions of the JDK.
JRE / Java RTE
- JRE stands for Java Runtime Environment, the component that fulfils the minimum requirements for the execution of a Java Application.
- It is considered as an implementation of a JVM which physically exists.. It consists of a JVM, library sets, java Core Classes, and supporting files, but contains no compiler, no debugger, and no tools.
- It basically serves the sole purpose of execution of a Java program/ application. It cannot be used to develop an app.
- Some of the utilities contained in a JRE are-
- Java 2D: An Application Programming Interface (API) used for drawing two-dimensional graphics in Java language. Developers can create rich user interfaces, special effects, games, and animations.
- Abstract Window Toolkit (AWT): A GUI (Graphical User Interface) used to create objects, buttons, scroll bars, and windows.
- Java Database Connectivity (JDBC) API: Provides tools for developers to write applications with access to remote relationship databases, flat files, and spreadsheets.
- Preferences API: A lightweight, cross-platform persistent API that enables multiple users on the same machine to define their own group of application preferences.
- Logging: Produces log reports—such as security failures, configuration errors, and performance issues—for further analysis.
- Java Archive (JAR): A platform-independent file format that enables multiple files to be bundled in JAR format, significantly improving download speed and reducing file size.
- JVM stands for Java Virtual Machine, an abstract platform – dependent computing mechanism.
- It is the core of Java Programming language and is one of the most integral part of both the JRE and JDK since it is already in-built or contained in them.
- Every program we build by using JRE and JDK are brought to the JVM for the correct execution. It executes a program line- by – line.
- We can thus also call it a Runtime Interpreter, which becomes an instance of JRE.
- The main tasks of a JVM constitute-
- Loading the code.
- Verifying it.
- Implementing it..
Differences between JDK,JRE and JVM
|JDK (Java Development Kit)
|JRE (Java Runtime Environment)
|JVM (Java Virtual Machine)
|Used for Java development, including writing, compiling, and debugging code.
|Used for executing Java applications. It contains the necessary runtime environment.
|Executes Java bytecode on a specific platform.
|– Compiler (javac) for source code to bytecode conversion. – Debugger (jdb) for debugging. – Various tools and utilities.
|– Java libraries and core classes. – JVM (Java Virtual Machine) for running Java bytecode.
|– Responsible for executing Java bytecode. – Different implementations for various platforms.
|Necessity for Running Java Code
|Not required on the end-user’s machine to run Java applications.
|Required on the end-user’s machine to run Java applications.
|Required on the end-user’s machine to execute Java applications.
|Code can be developed on one platform and executed on another with the appropriate JRE.
|Provides the runtime environment needed to run Java applications on a specific platform.
|Executes Java bytecode on the user’s machine, making it platform-dependent.
|Use in Development
|Essential for writing and compiling Java code.
|Not used during development but needed for running Java applications.
|Not used directly in development, as it’s responsible for executing compiled Java bytecode.
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others