# JDK vs JRE vs JVM

JDK is a software development tool for Java with environment (runtime). JDK compose of JRE (Java runtime) , Java intrepreter, Java compiler(javac) and archiver(jar).

```
JDK = JRE + Developer Tools 
```

JRE is a runtime environment that use for execute Java language.

```
JRE = JVM + Library class
```

**How JRE work?**&#x20;

When you finished to implement the code, your code will be compiled from source code to byte code by **javac** at runtime.

**Example**

```
source code                     byte code 
Hello.java         --->        Hello.class
```

In the runtime period, it will have 3 process occur including&#x20;

1. Class loader
2. Byte code verifier
3. Interpreter

**Class Loader**

This process will load essential class for execution from hard disk or network or other resource.

**Byte Code Verifier**

This process  will verify about format of code and object pointing.

**Interpreter**

Interpreter will be interpreter of byte code and hardware when execute java program in each line of code.

**JVM** (Interpreter)

JVM is the most important part of JDK and JRE. JVM will execute java program in each line.

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev7days.gitbook.io/dev7days/java/jdk-vs-jre-vs-jvm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
