Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 11

Introduction to Java

Architecture
JVM
Java Virtual Machine

Author: Chandra Bhanu.B


Java Architecture
Java Architecture arises about 4 distinct but interrelated
technologies, each of which defined by separate specification
from Sun Microsystems
      Java Programming Language
      Java class file format
      Java API
      JVM

When you write and run Java program, you are tapping the
power of these four technologies. You express the program
in source files written in Java programming language,compile
the source to java class files and run the classes on a JVM.
When you write your program you can access system
resources such as I/O by calling methods in the classes that
implement the Java application programming interface or
Java API.
Author: Chandra Bhanu.B
Java Development and Runtime Environments

   Java source code utilizes a standard Java API


   and a compilation process that produces executable code adhering to
 a standard Java Class File Format

Java Development & Runtime Environment

Compile
Java Application source code
Java Compiler
Java API

Java Application class files Executes

Java 2 Runtime Platform

Author: Chandra Bhanu.B


Java Runtime Platform Architecture
JVM(Java Virtual Machine) Definition:
An imaginary machine that is implemented by emulating it in software
on a real machine. Code for the jvm is stored in .class files, which
contains code for at most the class that we create.
The runtime architecture for the Java platform is that, The Java
application class file format is actually expressed in terms of byte codes.
Byte codes are similar to assembly-language instructions. Byte code
instructions are executed within the context of a virtual machine (that is,
the JVM) that operates above an operating system level. The main
components illustrated in the figure help provide such platform
independence and are briefly described here:
       Byte Code Verifier
The byte code verifier analyzes a byte code stream corresponding to a
Java class and verifies that this byte stream to the Java language rules
defined for classes.
 
Author: Chandra Bhanu.B
Java Runtime Platform Architecture
   Class Loader
The Class Loader is responsible for loading Java class byte codes
from an I/P stream (for ex: from a n/w or file), including a byte code
verifier to verify these byte codes including security checks via the
Java security interfaces and then handing the classes off to the Java
runtime execution engine. In the below diagram Class Loader was
shown only once but in reality every executing application in a JVM will
be running in a separate Class Loader environment. Java application
can use two types of Class Loaders: a “primordial” (primitive) class
loader and class loader objects.
 
The Primordial class loader is a part of the JVM (Each
implementation has only one primordial class loader).

  At runtime Java application can install class loader objects that load
classes in custom ways, such as downloading class files across a
network. Author: Chandra Bhanu.B
Java Runtime Platform Architecture

Java Application class files

Class Byte
ByteCode
CodeVerifier
ClassLoader
Loader Verifier

Java
JavaAPI
APIclass
class
Java
JavaRuntime
Runtime files
Execution files
Execution
Engine
Engine Native
NativePlatform
Platform
Interface
InterfaceLibraries
Libraries

Operating System

Hardware Platform

Author: Chandra Bhanu.B


Java Runtime Platform Architecture
 Java Runtime Execution Engine
The runtime execution is the warehouse that actually executes the
byte codes that have been loaded by type class loader and verified by
the byte code verifier. The runtime engine is the core of the JVM. The
JVM also includes the class loader and byte code verifier.
 
 Java API class files
The Java API class files are the executable Java code implementing
the standard Java platform API. Many of the standard Java APIs such
as networking and threading libraries make the native platform calls
via a set of native platform interface libraries.

 Native Platform Interface Libraries


The native platform interface libraries make native calls to underlying
platform libraries and resources on behalf of the Java APIs.
Author: Chandra Bhanu.B
Why Platform Independence?

One of the key reasons Java technologies is useful in a


networked environment is that Java enables you to create
binary executables that will run unchanged on multiple
platforms. This capability is important in a networked
environment because networks usually interconnect many
different kinds of computers and devices. An internal network
at a medium sized company might connect Macintoshes in an
art department, UNIX workstations in engineering, and PCs
running Windows everywhere else.
 

Author: Chandra Bhanu.B


Java Virtual Machine
Class Loader system

Heap Java PC Native


Stacks Register method
stacks

Class Loader system


Class Loader

Author: Chandra Bhanu.B


Java IDE Jdk 1.3
Other Development
Java Compiler Java Debugger
Tools

Java Client Compiler Java Plugin

Sound Api naming


Java Hot Spot Applet awt io lang
Run Time Math net rmi security
Text util swing sql

Windows Solaris Linux Mac OS


Author: Chandra Bhanu.B
Author: Chandra Bhanu.B

You might also like