Understanding JDK, JRE, JVM and the Java Flow

java dev.to

Understanding JDK, JRE, JVM and the Java Flow ☕

Today I learned how Java programs actually work internally.

What I Learned

JDK (Java Development Kit)

Used for developing Java applications.

It contains:

  • Compiler (javac)
  • JRE
  • Development tools

JRE (Java Runtime Environment)

Provides the environment required to run Java programs.

JVM (Java Virtual Machine)

Executes Java bytecode and makes Java platform independent.


Java Working Flow

```text id="dsvx9f"
Hello.java

Compiled using javac

Hello.class

Executed by JVM

Output




---

## Compile vs Run

### Compile Code

Converts:



```text id="f7i9pn"
.java → .class
Enter fullscreen mode Exit fullscreen mode

Command:

```bash id="1o84xq"
javac Hello.java




### Run Code

Executes the compiled bytecode using JVM.

Command:



```bash id="h5mr7f"
java Hello
Enter fullscreen mode Exit fullscreen mode

Key Takeaway

```text id="9m1ci6"
JDK → Develop
JRE → Run
JVM → Execute




Understanding these basics helped me connect how Java code moves from source code to actual output.

Learning Java step by step every day. 🚀

#java #beginners #programming #backend #coding #developers #100DaysOfCode
Enter fullscreen mode Exit fullscreen mode

Source: dev.to

arrow_back Back to Tutorials