0% found this document useful (0 votes)
703 views

JVM Presentation

Java is a programming language originally developed by James Gosling at Sun Microsystems. Java applications are compiled to bytecode that can run on any Java Virtual Machine (JVM) regardless of the underlying computer architecture. The JVM is a software layer that converts Java bytecode into machine code that can be executed on different platforms, allowing Java to be "write once, run anywhere." Key components of the JVM include the bytecode verifier, class loader, execution engine, garbage collector, and security manager.

Uploaded by

anshul siwach
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
703 views

JVM Presentation

Java is a programming language originally developed by James Gosling at Sun Microsystems. Java applications are compiled to bytecode that can run on any Java Virtual Machine (JVM) regardless of the underlying computer architecture. The JVM is a software layer that converts Java bytecode into machine code that can be executed on different platforms, allowing Java to be "write once, run anywhere." Key components of the JVM include the bytecode verifier, class loader, execution engine, garbage collector, and security manager.

Uploaded by

anshul siwach
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Java

• Java is a programming language originally developed


by James Gosling at Sun Microsystems.

• The language derives much of its syntax from C and C+


+ but has a simpler object model and fewer low-
level facilities.

• Java applications are typically compiled to byte code


(class file) that can run on any Java Virtual
Machine (JVM) regardless of computer architecture.
Virtual machine
• Before understanding what is JVM let us first
know what virtual machine is.

• A virtual machine is a layer of abstraction that


gives a program one simplified interface for
interacting with a variety of physical computers
and their operating systems.
Java virtual machine

• As the name indicates, JVM is not a real hardware


machine but a software layer which resembles an
hardware platform.

• JVM converts Java byte code into machine language


and executes it.

• The byte code can be executed on any platform where


there exist JVM.
• JVM‘s are available for many hardware and
software platforms.

• The use of the same byte code for all JVM’s on all
platforms allows Java to be described as a "write once,
run anywhere" programming language.

• Thus, the JVM is a crucial component of the Java


platform.
Diagram of JVM
Components of JVM
1. Byte code verifier
2. Class loader
3. Execution engine
4. Garbage collector
5. Security Manager
Byte code verifier
• As the name suggests, bytecode verifier is used to verify
the bytecode.

• Bytecode verifier checks for unusual code.

• Byte code verifier is a crucial component for security.


Class loader
• Class loader loads java classes into java virtual machine.

• All Java virtual machines include one class loader that is


embedded in the virtual machine.

• The main feature of the class loader is that JVM.


doesn’t need to have any knowledge about the classes
that will be loaded at runtime.

• Class loader reads bytecode and creates the instance of


java.lang.class.
Execution engine
• The execution engine helps JVM to convert bytecode
into machine code.

• It has two parts:


a) Interpreter
b) Just-in-time-interpreter

• Execution engine is responsible for executing the


instructions contained in the methods of loaded classes.
Garbage collector
• Garbage collection is the process of automatically
freeing objects that are no longer referenced by the
program.

• It periodically check for the object on heap , whose link is


broken so it can collect garbage from heap.

• Garbage collection relieves java programmer


from memory management.
Security manager
• Security manage constantly monitors the code.

• It is special java object that is responsible for guarding


security policies for java applications.

• It is always consulted before any potentially dangerous


operation is requested by a java application.
Comparison of JVM
Other software:

JVM:
• Java Virtual Machine (JVM) is platform independent,
meaning it can run on different Operating Systems (OS)
like Windows or UNIX.

• JVM does not really exist but is created within another


environment.

• As long as a JVM is available natively to a system, a


Java program can run in the system.

• The JVM stands on top of the operating system (OS),


which means it is independent of the OS.
Advantages
• Security
• Cross Platform

Disadvantages:
• Speed
• Platform Specific Features

You might also like