Java Architecture
Java Architecture
James Gosling
Patrick Naughton
Mike Sheridan
The origin of Javacan be traced back to the fall of 1991, and was
(Java)
Bytecode
Verifier step4
Java
step2
Bytecodes
move locally Just in
Java Compiler Java
Time step5
or through Interpreter
Compiler Java
network
Virtual
machine
Runtime System
Java
Bytecode
(.class ) Operating System
Hardware
Step1:
Create ajava source code with java extension
Step2:
Compile the source code using java compiler, which will create bytecode file with .class
extension
Step3:
Class loader reads both the user defined and library classes into the memory forexecution
Bytecode verifier validates all the bytecodes are valid and do not violate Java's security
restrictions
Step5:
JVM reads bytecodes and translates into machine code for execution. While execution of the
program the code will interact to the operating system and hardware
1. Edit
3. Loading
Use a class loader to read bytecodes from .class file into memory
Use a Bytecode verifier to make sure bytecodes are valid and do not violate security
restrictions
5. Execute
• Applications are run on user's machine, i.e. executed by interpreter with java command
(java Welcome)
class HelloWorldApp
public static void main (Stringl]args)
• The output of the compiler is bytecode
System.out.println ("HO115 World)
The bytecodes are executed by JVM
HelloOrldApp.java • It is an interpreter which converts the
byte code to machine specific
Compiler
instructions
JVM JVM and executes
JVM
• JVM is platform specific
Interpreting a Java program into byte code facilitates its execution in a wide variety of
environments
The Java Architecture - The JVM (Contd.).
Only the Java Virtual Machine (JVM)needs to be implemented for each platform
Once the Java runtimepackage exists for a given system,any Java program can run on it
The use of bytecode enables the Java runtime system to execute programs much faster
15
Sensitivity. Internal & Restricted 2017 Wipro WIproCom confdenia
The Java Architecture -The Adaptive optimizer
Another type of execution engine is an adaptive optimizer
It also keeps a tab on the code that is running and identifies only the heavily used areas
The JVM compilesthese heavily used areas of code into native code
The rest of the code, which is not heavily used continues to be interpreted and executed
A security standpoint
Network mobility
The class loader loads a compiled Java source file (.class files represented as bytecode) into
The bootstrap class loader is responsible for loading the classes, programmer defined clas:
network mobility
The class file is compiled to a target JVM, but independent of underlying hostplatforms
The Java class file is a binary file that has the capability to run on any platform