Difference Between JDK vs JRE vs JVM
Explore the main differences between these essential Java tools.
Join the DZone community and get the full member experience.Join For Free
Today, we will discuss the introduction to JDK vs JRE vs JVM.
What Is the Java Development Kit (JDK)?
The JDK stands for Java Development Kit used for developing Java applets and apps. It is basically a software development environment. JDK includes Java Runtime Environment (JRE), which happens to be a loader/interpreter, a compiler called (javac), a document generator (Javadoc), an archiver (jar), and other tools required in development.
- Loads code
- Verifies code
- Executes code
- Provides the runtime environment
What Is the Java Runtime Environment (JRE)?
Java Runtime Environment or JRE is also known as Java RTE. The Java Runtime Environment contains core classes and supporting files; it also contains Java Virtual Machine (JVM). It provides the runtime environment.
- A particular where the working of Java Virtual Machine is determined. Be that as it may, usage supplier is free to pick the calculation. Its usage has been given by Sun and different organizations.
- An implementation is a PC program that meets the prerequisites of the JVM particular.
- Runtime Instance Whenever you compose a Java order on the summon provoke to run the Java class, an occasion of JVM is made.
- JDK or Java Development Kit is a kit that physically exists. It contains JRE+ and other tools.
What Is the Java Virtual Machine (JVM)?
JVM provides a runtime environment for executing Java bytecode. It is an abstract machine that is platform-dependent and has three notions as a specification, a document that describes requirement of JVM implementation, implementation, a computer program that meets JVM requirements, and instance, an implementation that executes Java bytecode.
Main Tasks of the JVM Are:
- Loading Code
- Verifying Code
- Executing Code
- Providing Runtime Environment
Difference Between JDK, JRE, and JVM
Consider the following diagram.
JDK Vs. JRE Functions
What Does the JRE Comprise Of?
JRE comprises the accompanying segments.
- Deployment Techniques – It includes arrangement, Java Web Start, and Java Plug-in.
- UI toolkits – User Interface including Abstract Window Toolkit (AWT), Swing, Java 2D, Accessibility, Image I/O, Print Service, Sound, intuitive (DnD), and information techniques.
- Integration libraries – It includes Interface Definition Language (IDL), Java Database Connectivity (JDBC, Remote Method Invocation (RMI), Remote Method Invocation over Internet Inter-Orb Protocol (RMI-IIOP) ), Java Naming and Directory Interface (JNDI), and scripting.
- Other base libraries, including worldwide help, input/yield (I/O), expansion instrument, Beans, Java Management Extensions (JMX), Java Native Interface (JNI), Math, Networking, Override Mechanism, Security, Serialization, and Java for XML Processing (XML JAXP).
- Lang and util base libraries – It includes lang and util, administration, forming, zip, instrument, reflection, Collections, Concurrency Utilities, Java Archive (JAR), Logging, Preferences API, Ref Objects, and Regular Expressions.
- Java Virtual Machine (JVM), including Java HotSpot Client and Server Virtual Machines.
How About JRE Functions?
See how the JRE functions let us consider a Java source record spared as Example.java. The record is incorporated into an arrangement of ByteCode that is put away in a “.class” document. Here, it will be “Example.class."
Actions at Runtime:
ClassLoader stacks every vital class required for the execution of a program. It gives security by isolating the namespaces of the nearby record framework from that imported through the system. These records are stacked either from a hard plate, a system or from different sources.
The JVM puts the code through the
ByteCode Verifier that checks the format and checks for an illicit code. Illicit code, for instance, is code that disregards rights on objects or abuses the execution of pointers.
The ByteCode Verifier guarantees that the code holds fast to the JVM particular and does not damage framework respectability.
- Java Interpreter
At runtime, the ByteCode stacked, checked, and kept running by the mediator. The translator has the accompanying two capacities:
- Execute the ByteCode
- Make proper calls to the hidden equipment
How About JVM Functions?
JVM turns into an occurrence of JRE at runtime of a Java program. It is generally known as a runtime interpreter. JVM — to a great extent — helps in the deliberation of internal execution from the software engineers who make utilization of libraries for their projects from JDK.
In this Java tutorial, we learned about what is the JRE, JVM, and JDK. In addition, we explored the basic differences between JRE, JVM, JDK, with examples. Furthermore, if you have any further questions, feel free to ask in a comments section below.
Published at DZone with permission of Rinu Gour. See the original article here.
Opinions expressed by DZone contributors are their own.