Understanding of JVM

Ashwani Singh
2 min readOct 16, 2022

Every Java Developer Knows bytecode is executed by JRE , but JRE is implementation of JVM. “which analyses the bytecode,interprets the code and executes it”.

Java follows concept of ‘Write Once Run Anywhere

The compiler compiles the java file into class file , then .class file is input into JVM which loads and executes it.

JVM

Java’s is portable because it makes its compiler output bytecode rather than executable code. The bytecode is a set of instructions which is executed by the JVM.

After translating the Java code into bytecode, it becomes portable and can be run in numerous environments, because all that is required is for a Java Runtime Environment — which also includes the JVM — to be implemented on each platform.

Once a JRE is present on any system, then a Java application can run on it because all JREs understand the Java bytecode.

The JDK (Java Development Kit) is a software development environment where Java applications are developed.

This contains the JRE + Development tools

This also exist physically.

There are several different types of platforms released by Oracle as well.

The JDK is like the full package that is necessary to develop a Java application as it has its own private Java Virtual Machine, an interpreter, a compiler, an archiver etc.

JDK=JRE+Development Tools
JDK=JRE+Development Tools

JDK contains:

  • Java Runtime Environment (JRE),
  • An interpreter/loader (Java),
  • A compiler (javac),
  • An archiver (jar) and many more.

Why is JDK used?

The Java Development Kit contains a variety of tools and Java development information. Deploying Java software is as easy as downloading JDK software and blending it with the classpath. After downloading at the time of installing JDK, choosing the correct version of Java will be the only way to execute the program. Java 8 is a commonly used version, but Java 10 is the latest version also available online.

A set of directories — JDK is used in the application of the Java platform specification, including the class libraries as well as the compiler. It can also be called as the superset of the JRE.

Purpose of JDK

The main purpose f JDK is to compile the code and to convert the java code into the bytecode, where the JRE is necessary to execute those bytecodes.

--

--