


Note: ClassLoaders follow the Delegation Hierarchy Algorithm while loading the. System/Application Class Loader: It loads the application-specific classes from the system classpath set while invoking a program.Extension Class Loader: It passes all the class loading requests to its parent class, Bootstrap, and if unsuccessful, it loads classes using extension classpath.It loads the main JDK classes from the bootstrap classpath. Bootstrap Class Loader: It acts as the parent of all the other Class Loaders in Java.The three ClassLoaders that help in achieving this are BootStrap ClassLoader, Extension ClassLoader, and Application ClassLoader. Loading the compiled classes (.class files) is the primary task of the Class Loader. Let’s discuss the three functions of the Class Loader in detail. This occurs when the loaded class is referring to another class for the first time (during runtime). It is mainly responsible for loading, linking and initialising the loaded class (.class file).

The class loader is a subsystem that handles Java’s dynamic class loading. In the coming sections, we shall study each aspect of the JVM Architecture as shown in the diagram above. Let’s learn more deeply about the JVM architecture and different components of the JVM as follows: It is crucial to know the JVM architecture, as it enables us to write code efficiently. But many don’t know that JRE is an implementation of Java Virtual Machine (JVM) only, which analyses, interprets and executes the bytecode. This is why Java is considered a platform-independent language (write once, run anywhere).Įvery Java developer is well aware of the fact that it is the Java Runtime Environment (JRE) that executes the bytecodes. This means that the byte code generated on macOS can be executed on Windows and vice versa. These byte codes are easily understandable by JVM.Įach Operating System has its own JVM, but the output they produce after the byte code has been executed is the same across all of them. Since the JVM does not comprehend Java source code, we need a javac compiler to compile. JVM is a virtual machine that executes the Java byte code on an actual device (your computer). JVM is the foundation of the Java programming language and the reason behind Java’s cross-platform compatibility and minimal compiled code size. The Java Virtual Machine (JVM) is an abstract computing machine with a memory-based instruction set.
