When I started learning Java, I was confused by terms like JDK, JRE, JVM, and JIT.
They sounded similar, but each one has a different purpose.
In this blog, Iβll explain these concepts in a simple and beginner-friendly way.
πΉ What is JDK?
JDK (Java Development Kit) is used to write and develop Java programs.
It contains:
β’ JRE
β’ Compiler (javac)
β’ Debugger
β’ Development tools
π If you want to write and compile Java code, you must install JDK.
Example Java File:
Syntax.java
If there is a mistake in code, then we will encounter a syntax error.
To compile Java code:
javac Syntax.java
If compilation is successful, a new Syntax.class will be generated in the location where your Syntax.java file is located
πΉ What is JRE?
JRE (Java Runtime Environment) provides required environment to run Java applications.
It contains:
β’ JVM
β’ Core Java libraries
β’ Supporting files
π If you only want to run a Java program, JRE is enough.
πΉ What is JVM?
JVM (Java Virtual Machine) is the heart of Java.
β’ It executes Java bytecode
β’ It makes Java platform independent
β’ It converts bytecode into machine code
π Java program β compiled into bytecode β JVM runs it
πΉ What is JIT?
JIT (Just-In-Time Compiler) is part of JVM.
β’ Improves performance
β’ Converts frequently used bytecode into native machine code
β’ Makes Java programs run faster over time
π JIT helps Java achieve better speed and efficiency.
Top comments (0)