General Workflow of a Java Program
Trying to wrap your head around compile-time workflow of a java program, here’s a post to help you.
Compiling source code
The source code must be compiled into machine code in order to become and executable program.This compilation process is referred to as compile time.Source code is written according to basic java notations and saved under extension .java and after compilation a generic byte code is produced under extension .class,this byte code is operating system independent.OS independent means once you produced a byte code then you can run it multiple times on multiple operating system.
Byte code is OS independent because JVM(java virtual machine) is OS dependent.
A Java virtual machine (JVM) is an abstract computing machine that enables a computer to run a Java program.JVM is different for every operating system as it produced differnt object code compatible to different OS.This object code is compatible as well as Executable.
Class loader is used to load the byte code into the virtual machine.
2.Byte code verification
Byte code is verified that it is correct and according to norms.
Just in time(JIT) compiler is used by JVM to run the queue of runnable commands.