Byte code and JVM

Byte code and JVM

Java is a high level programming language. The program written in java is compiled for conversion to an intermediate code called Byte code.This code is independent of the machine on which the program is to run.This makes a java program highly portable as its Bytes code can easily be transferred from one system to another.When this byte code is to be run on any system an interpreter,known as java Virtual Machine ( JVM) is needed which translates the byte code to machine code.

Java machine code varies for different platforms like windows, UNIX, OS -2 etc.Thus java Interpreter Converts Bytes Code to the machine code accordingly.

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java byte code can be executed. JVM acts as a virtual processor. Which processes the byte code to machine code instruction for various platforms. That is why it is called Java Virtual Machine.

Thus the java program uses compiler as well as interpreter both.

JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent The JVM performs following main tasks:

  • Loads code
  • Verifies code
  • Executes code
  • Provides run time environment

Comments are closed.