DEV Community

CodeStorm
CodeStorm

Posted on

JDK, JVM, JRE Explained – What Every Java Developer Should Know

When you dive into Java for the first time, you come across three terms instantly before you even start programming. Knowing what JDK, JRE, and JVM are is essential to every Java developer. Simply googling these three terms will give you thousands of definitions and explanations of what they are and how they work. In this post, we will try to learn these three things in the simplest way possible.

1.JVM (Java Virtual Machine)
We know that Java lets programmers write once, run anywhere (WORA), or Write once, and run everywhere (WORE). This illustrates one of the core features of Java being cross-platform or platform-independent. How does this happen?

When you write your Java code and compile it it turns the code into bytecode which is an intermediary between human-readable and machine-readable code. Now this code can be run on any platform that has JVM.

-JVM converts this bytecode into machine-readable code.
-It runs the programs and takes care of all the background stuff users should not worry about.
-JVM is a subset and part of JRE and JDK as we will learn further.

2.JRE (Java Runtime Environment)
JRE is the basic requirement needed in a system to run a Java application.JRE consists of JVM and its supported standard library classes which are required to run the application.

3.JDK (Java Development Kit)
JDK is the software development kit containing all your development tools required to write, compile, debug, and run a Java program. It contains a javac(Java compiler ), a debugger, Java library source code, and many more tools. It is also a superset of JRE and JVM.

Below is the complete JAVA 8 SE component diagram from oracle:

Image description

Source - https://docs.oracle.com/javase/8/docs/index.html

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →