What is Java Virtual Machine?

Praveen Fernando
2 min readJun 9, 2022

--

Before getting into the Java virtual machine, First, let's learn what is Virtual machine.

Virtual means that something doesn’t physically exist. Simply we can get it as it’s not in the reality. A machine is a device or equipment which helps you to do your work. So, a Virtual machine really means a machine that does not physically exist in the real world but exists in virtually.

Therefore, JVM is something that does not exist physically because it is just a program, which you can’t install or uninstall But you can install JRE and JDK.

There are 2 types of virtual machines.

  • System-based Virtual Machine (SVM)
  • Application-based Virtual Machine (AVM)

Let’s dive deep into these virtual Machines.

System-based Virtual Machine (SVM)

SVM has one or more hardware, which can create multiple environments to work with multiple users or instances. Most importantly these environments are completely independent.

Ex:- Hypervisor, Xen

Application-based Virtual Machine (AVM)

AVM doesn’t have any hardware device involved but you have an application to help you to create a platform to run other programs. Since this is a process we also can call it a process-based virtual machine also.

Ex:- JVM, CLR, PVM

Out of these two types of categories, JVM falls under Application-based virtual machine. So that’s why we previously discuss there is nothing really called install or uninstall in JVM.

JVM is a completely a specification and it comes with the JRE. Once you download and install it in Windows or macOS, the Java Runtime Environment(JRE) deploys all the codes which need to create the JVM environment. When you execute a java program it creates a JVM instance and converts the java code or byte code into the machine code, which your operating system can understand. That is how java became platform-independent.

Reference

https://youtu.be/bUtIIWbaFKc

--

--