General Workflow of a Java Program

Published Sep 04, 2017

Trying to wrap your head around compile-time workflow of a java program, here’s a post to help you.

Basic workflow
JavaArchitecture2.jpg

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.

JVM
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.

Advance workflow
JavaArchitecture3.jpg

JVM classification
1.Class loader
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.
3.Execution engine
Just in time(JIT) compiler is used by JVM to run the queue of runnable commands.

Discover and read more posts from Nishant Rana
get started
Enjoy this post?

Leave a like and comment for Nishant