Saturday, 8 October 2011

Java Virtual Machine



Introduction

All language compilers translate source code into machine code for a specific computer. Java compiler also does the same thing. Then , How does Java achieve architecture neutrality? The answer is that the Java compiler produces an intermediate code known as bytecode for a machine that does not exists. This machine is called the Java Virtual Machine and it exists only inside the computer memory .It is a simulated within the computer and does all major functions of a real computer. Below figure illustrates the process of compiling a Java Program into bytecode which is also referred to as virtual machine code.
The Virtual machine code is not machine specific. The machine specific code (known as machine code) is generated by the Java interpreter by acting as an intermediary between the virtual machine and the real machine as shown in below figure. Remember that the interpreter is different for different machines.
Following Figure shows whole Java works on a typical computer The Java Object framework(Java API) acts as the intermediary between the user programs and the virtual machine which in turn acts as the intermediary between the operating system and the Java object framework.








Posted by: Ruchita  Pandya

No comments:

Post a Comment