SlideShare a Scribd company logo
Java Fundamental
Java Architecture
Various components of the Java architecture are:
 Java programming language
 Java class file
 Java Virtual Machine (JVM)
 Java Application Programming Interface (API)
Java Programming Language and
class File
Java programs are saved with an extension, .java.
A .java file is compiled to generate the .class file, which contains the Bytecode.
The JVM converts the Bytecode contained in the .class file to machine object code.
The JVM needs to be implemented for each platform running on a different operating
system.
Java Virtual Machine (JVM)
The JVM forms the base for the Java platform and is convenient
to use on various hardware-based platforms.
Components of the JVM
JVM for different platforms uses different techniques to execute the Bytecode. The
major components of JVM are:
 Class loader
 Execution engine
 Just In Time (JIT) compiler
ClassLoader Subsystem
Java's dynamic class loading functionality is handled by the ClassLoader subsystem. It loads, links. and initializes the class
file when it refers to a class for the first time at runtime, not compile time.
1.1 Loading
Classes will be loaded by this component. BootStrap ClassLoader, Extension ClassLoader, and Application ClassLoader are
the three ClassLoaders that will help in achieving it.
1. BootStrap ClassLoader– This is the first classloader which is the super class of Extension classloader. It loads
the rt.jar file which contains all class files of Java Standard Edition like java.lang package classes, java.net package
classes, java.util package classes, java.io package classes, java.sql package classes etc.
2. Extension ClassLoader – Responsible for loading classes which are inside the ext folder (jrelib).
3. Application ClassLoader –Responsible for loading Application Level Classpath, path mentioned Environment Variable,
etc.
1.2 Linking
1. Verify – Bytecode verifier will verify whether the generated bytecode is proper or not if
verification fails we will get the verification error.
2. Prepare – For all static variables memory will be allocated and assigned with default values.
3. Resolve – All symbolic memory references are replaced with the original references from
Method Area.
1.3 Initialization
This is the final phase of ClassLoading; here, all static variables will be assigned with the original
values, and the static block will be executed.
Execution Engine
The Java execution engine is the component of the JVM that runs the Bytecode one
line after another. The execution engines implemented by different vendors use
different techniques to run the Bytecode. The Java execution engine converts the
Bytecode to the machine object code and runs it.
JIT Compiler
The JIT compiler is used for compiling the Bytecode into executable code. The JVM
runs the JIT compiled code without interpreting because the JIT-compiled code is in
the machine code format. Running the JIT- compiled code is faster than running the
interpreted code because it is compiled and does not require to be run, line after line.
Java Application Programming
Interface (API)
The Java API is a collection of software components that provide capabilities, such as
GUI. The related classes and interfaces of the Java API are grouped into packages.
The following figure shows how the Java API and the JVM forms the platform for the
Java programs on top of the hardware:
Java Architecture Security
Java architecture also consists of a few security features that make Java a secure
programming language. The architecture consists of the following security features:
 Compiler level security
 Bytecode verifier
 Class loader
 Sandbox model
Java Virtual Machine (JVM) and just in time compilation
Compiler Level Security
Java prevents errors that arise due to improper memory usage, reducing the compile-
time errors. In addition, Java employs typecasting between data types that implies
that when one type of data is assigned to another type of variable, an automatic type
conversion takes place.
Typecasting in Java ensures that there is no data loss in the result or output of a Java
code.
Bytecode Verifier
The Bytecode verifier checks the Bytecode before it runs on a computer. It ensures
that the Bytecode does not violate access restrictions, such as read/write operations,
and verifies that the Bytecode does not forge pointers. The Bytecode is verified in two
phases:
 In the first phase, the verifier checks for the structure of the .class file.
 The second phase occurs when the Bytecode is run. The Bytecode verifier checks
the validity of classes, variables, and methods used in a program.
Class Loader
The class loader determines how and when an applet will use classes in a running Java
environment. In a Java environment, there can be many class loaders and each class
loader can create its own run-time environment. The class loader loads all the applets
and their references.
Sandbox Model
The sandbox model is implemented in the Java applets container, such as Web
browsers. The sandbox model determines the limitations of Java applets that they can
only access the resources of the host computer and cannot access the files on the
local computer. Java applications do not employ this security model and are allowed to
read from and write to files on the local computers.
Ad

More Related Content

Similar to Java Virtual Machine (JVM) and just in time compilation (20)

JAVA for Every one
JAVA for Every oneJAVA for Every one
JAVA for Every one
Satyam Pandey
 
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Rhythm Suiwal
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
Laxman Puri
 
Advanced java training in bangalore
Advanced java training in bangaloreAdvanced java training in bangalore
Advanced java training in bangalore
siyaram ray
 
Advanced java-training-in-bangalore
Advanced java-training-in-bangaloreAdvanced java-training-in-bangalore
Advanced java-training-in-bangalore
siyaram ray
 
JVM.pptx
JVM.pptxJVM.pptx
JVM.pptx
ParvathiPPSGRKCW
 
JAVA Program Examples
JAVA Program ExamplesJAVA Program Examples
JAVA Program Examples
Prof Chethan Raj C
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
Nikhil Sharma
 
JVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfJVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdf
Geekster
 
Java architecture
Java architectureJava architecture
Java architecture
Rakesh Vadnala
 
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
vishnuprasath2603
 
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
vishnuprasath2603
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
Surbhi Panhalkar
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
baabtra.com - No. 1 supplier of quality freshers
 
Java2020 programming basics and fundamentals
Java2020 programming basics and fundamentalsJava2020 programming basics and fundamentals
Java2020 programming basics and fundamentals
swecsaleem
 
Android Training Chandigarh
Android Training ChandigarhAndroid Training Chandigarh
Android Training Chandigarh
Sheetal Sharma
 
Mobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationMobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android Installation
Dr. Chandrakant Divate
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
10322210023
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
Jerry Kurian
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
Shipra Swati
 
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Rhythm Suiwal
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
Laxman Puri
 
Advanced java training in bangalore
Advanced java training in bangaloreAdvanced java training in bangalore
Advanced java training in bangalore
siyaram ray
 
Advanced java-training-in-bangalore
Advanced java-training-in-bangaloreAdvanced java-training-in-bangalore
Advanced java-training-in-bangalore
siyaram ray
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
Nikhil Sharma
 
JVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfJVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdf
Geekster
 
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
vishnuprasath2603
 
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...JAVA ARCHITECTURES PPT  | "Mastering Java: A Comprehensive Guide to Core Conc...
JAVA ARCHITECTURES PPT | "Mastering Java: A Comprehensive Guide to Core Conc...
vishnuprasath2603
 
Java2020 programming basics and fundamentals
Java2020 programming basics and fundamentalsJava2020 programming basics and fundamentals
Java2020 programming basics and fundamentals
swecsaleem
 
Android Training Chandigarh
Android Training ChandigarhAndroid Training Chandigarh
Android Training Chandigarh
Sheetal Sharma
 
Mobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android InstallationMobile Application Development- Configuration and Android Installation
Mobile Application Development- Configuration and Android Installation
Dr. Chandrakant Divate
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
10322210023
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
Jerry Kurian
 

Recently uploaded (20)

Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Using the Artificial Neural Network to Predict the Axial Strength and Strain ...
Journal of Soft Computing in Civil Engineering
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Working with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to ImplementationWorking with USDOT UTCs: From Conception to Implementation
Working with USDOT UTCs: From Conception to Implementation
Alabama Transportation Assistance Program
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Generative AI & Large Language Models Agents
Generative AI & Large Language Models AgentsGenerative AI & Large Language Models Agents
Generative AI & Large Language Models Agents
aasgharbee22seecs
 
Control Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptxControl Methods of Noise Pollutions.pptx
Control Methods of Noise Pollutions.pptx
vvsasane
 
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjjseninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
seninarppt.pptx1bhjiikjhggghjykoirgjuyhhhjj
AjijahamadKhaji
 
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
sss1.pptxsss1.pptxsss1.pptxsss1.pptxsss1.pptx
ajayrm685
 
DED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedungDED KOMINFO detail engginering design gedung
DED KOMINFO detail engginering design gedung
nabilarizqifadhilah1
 
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdfSmart City is the Future EN - 2024 Thailand Modify V1.0.pdf
Smart City is the Future EN - 2024 Thailand Modify V1.0.pdf
PawachMetharattanara
 
Design of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdfDesign of Variable Depth Single-Span Post.pdf
Design of Variable Depth Single-Span Post.pdf
Kamel Farid
 
Slide share PPT of NOx control technologies.pptx
Slide share PPT of  NOx control technologies.pptxSlide share PPT of  NOx control technologies.pptx
Slide share PPT of NOx control technologies.pptx
vvsasane
 
acid base ppt and their specific application in food
acid base ppt and their specific application in foodacid base ppt and their specific application in food
acid base ppt and their specific application in food
Fatehatun Noor
 
hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .hypermedia_system_revisit_roy_fielding .
hypermedia_system_revisit_roy_fielding .
NABLAS株式会社
 
Frontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend EngineersFrontend Architecture Diagram/Guide For Frontend Engineers
Frontend Architecture Diagram/Guide For Frontend Engineers
Michael Hertzberg
 
Machine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATIONMachine Learning basics POWERPOINT PRESENETATION
Machine Learning basics POWERPOINT PRESENETATION
DarrinBright1
 
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdfDavid Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry - Specializes In AWS, Microservices And Python.pdf
David Boutry
 
Nanometer Metal-Organic-Framework Literature Comparison
Nanometer Metal-Organic-Framework  Literature ComparisonNanometer Metal-Organic-Framework  Literature Comparison
Nanometer Metal-Organic-Framework Literature Comparison
Chris Harding
 
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdfATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ATAL 6 Days Online FDP Scheme Document 2025-26.pdf
ssuserda39791
 
Autodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User InterfaceAutodesk Fusion 2025 Tutorial: User Interface
Autodesk Fusion 2025 Tutorial: User Interface
Atif Razi
 
Lecture - 7 Canals of the topic of the civil engineering
Lecture - 7  Canals of the topic of the civil engineeringLecture - 7  Canals of the topic of the civil engineering
Lecture - 7 Canals of the topic of the civil engineering
MJawadkhan1
 
twin tower attack 2001 new york city
twin  tower  attack  2001 new  york citytwin  tower  attack  2001 new  york city
twin tower attack 2001 new york city
harishreemavs
 
Ad

Java Virtual Machine (JVM) and just in time compilation

  • 2. Java Architecture Various components of the Java architecture are:  Java programming language  Java class file  Java Virtual Machine (JVM)  Java Application Programming Interface (API)
  • 3. Java Programming Language and class File Java programs are saved with an extension, .java. A .java file is compiled to generate the .class file, which contains the Bytecode. The JVM converts the Bytecode contained in the .class file to machine object code. The JVM needs to be implemented for each platform running on a different operating system.
  • 4. Java Virtual Machine (JVM) The JVM forms the base for the Java platform and is convenient to use on various hardware-based platforms. Components of the JVM JVM for different platforms uses different techniques to execute the Bytecode. The major components of JVM are:  Class loader  Execution engine  Just In Time (JIT) compiler
  • 5. ClassLoader Subsystem Java's dynamic class loading functionality is handled by the ClassLoader subsystem. It loads, links. and initializes the class file when it refers to a class for the first time at runtime, not compile time. 1.1 Loading Classes will be loaded by this component. BootStrap ClassLoader, Extension ClassLoader, and Application ClassLoader are the three ClassLoaders that will help in achieving it. 1. BootStrap ClassLoader– This is the first classloader which is the super class of Extension classloader. It loads the rt.jar file which contains all class files of Java Standard Edition like java.lang package classes, java.net package classes, java.util package classes, java.io package classes, java.sql package classes etc. 2. Extension ClassLoader – Responsible for loading classes which are inside the ext folder (jrelib). 3. Application ClassLoader –Responsible for loading Application Level Classpath, path mentioned Environment Variable, etc.
  • 6. 1.2 Linking 1. Verify – Bytecode verifier will verify whether the generated bytecode is proper or not if verification fails we will get the verification error. 2. Prepare – For all static variables memory will be allocated and assigned with default values. 3. Resolve – All symbolic memory references are replaced with the original references from Method Area. 1.3 Initialization This is the final phase of ClassLoading; here, all static variables will be assigned with the original values, and the static block will be executed.
  • 7. Execution Engine The Java execution engine is the component of the JVM that runs the Bytecode one line after another. The execution engines implemented by different vendors use different techniques to run the Bytecode. The Java execution engine converts the Bytecode to the machine object code and runs it.
  • 8. JIT Compiler The JIT compiler is used for compiling the Bytecode into executable code. The JVM runs the JIT compiled code without interpreting because the JIT-compiled code is in the machine code format. Running the JIT- compiled code is faster than running the interpreted code because it is compiled and does not require to be run, line after line.
  • 9. Java Application Programming Interface (API) The Java API is a collection of software components that provide capabilities, such as GUI. The related classes and interfaces of the Java API are grouped into packages. The following figure shows how the Java API and the JVM forms the platform for the Java programs on top of the hardware:
  • 10. Java Architecture Security Java architecture also consists of a few security features that make Java a secure programming language. The architecture consists of the following security features:  Compiler level security  Bytecode verifier  Class loader  Sandbox model
  • 12. Compiler Level Security Java prevents errors that arise due to improper memory usage, reducing the compile- time errors. In addition, Java employs typecasting between data types that implies that when one type of data is assigned to another type of variable, an automatic type conversion takes place. Typecasting in Java ensures that there is no data loss in the result or output of a Java code.
  • 13. Bytecode Verifier The Bytecode verifier checks the Bytecode before it runs on a computer. It ensures that the Bytecode does not violate access restrictions, such as read/write operations, and verifies that the Bytecode does not forge pointers. The Bytecode is verified in two phases:  In the first phase, the verifier checks for the structure of the .class file.  The second phase occurs when the Bytecode is run. The Bytecode verifier checks the validity of classes, variables, and methods used in a program.
  • 14. Class Loader The class loader determines how and when an applet will use classes in a running Java environment. In a Java environment, there can be many class loaders and each class loader can create its own run-time environment. The class loader loads all the applets and their references.
  • 15. Sandbox Model The sandbox model is implemented in the Java applets container, such as Web browsers. The sandbox model determines the limitations of Java applets that they can only access the resources of the host computer and cannot access the files on the local computer. Java applications do not employ this security model and are allowed to read from and write to files on the local computers.
  翻译: