Introduction to the Java Virtual Machine

Download Report

Transcript Introduction to the Java Virtual Machine

Introduction to the Java Virtual
Machine
井民全
 JVM (Java Virtual Machine)
 the environment in which the java programs
execute
 The specification
 define an abstract computer, and the
instructions, called bytecode
 Bytecode
 a byte-long instruction that the javac generates
 Java interpreter executes
Compiler compiles a .java file,
it produces a series of bycodes and stores
them in a .class file.
The java interpreter can then execute the
bytecodes stored in the .class file
Introduction
 Java is more than just a language; it is a
computer environment
 design-time
java (the java language)
 runtime java (the JVM)
This machine can run Java
The machine
support the
java runtime
environment
It implements a JVM
Introduction
 Java Virtual Specification
 a document which defines how to implement a
JVM
 Implementation of Java Virtual Machine
 implementation of JVM follows this specification
 The JVM Specification is platform
independent

because, it can be implemented on any platform
Specification: Java.sun.com/docs/books/vmspec/index.html
Introduction
 The JVM performs following functions
 Allocating
memory for created objects
 Performing garbage collection
 Handing register and stack operations
 Calling on the host system for certain
functions, such as device access
 Monitoring the security of apps
Reference:
“memory management, role of JVM”, JBuilder Help: