The JVM is the core of the Java platform and is responsible for:
1. Loading bytecodes from the class files
2. Verifying the loaded byte codes
3. Linking the program with the necessary libraries
4. Memory Management by Garbage Collection
5. Managing calls between the program and the host environment.
Java sovles the problem of platform independence by using
byte code.Java complier does not produce native executable
code.Instead it produces a special format called byte code.
Byte code is a highly optimized set of instructions
designed to executed by a java runtime system called Java
Virtual Machine(JVM).JVM is an interpreter for byte code.
This interpreter reads or understands the bytecode and
executes the corresponding native machine instructions.
Thus to port java programs to a new platform ,all that
needed is to port the interperter and some of the library
routines.Even the complier is written in java.The byte
codes are precisely defined and remain the same on all
The use of byte code enables the java runtime system to
execute programs much faster.
JVM works is only to provide memory and resource allocation
.the conversion of bytecode into machine code is done by
J.I.T(just in time compiler)
if a program is executed on the same machine then the full
resources used by JVM else if on other system then less
resources used by JVM.