06 October 2010

0 What is JVM-Java Virtual Machine?

A virtual machine which will execute java byte code (.class file) is called Java Virtual Machine or the JVM. In other words, the compiled java code -the java byte code (.class file) is in the machine language format of a machine known as the Java Virtual Machine or the JVM. We always needs a JVM to execute the byte code. JVM is not a real machine, it is just a virtual machine; implemented in software.

JVM is platform dependent, Java Code is platform independent.

JVM is platform dependant; that is, there is one JVM for Windows, another one for UNIX, yet another one for Mac etc. All JVMs accept the same input, the byte code. Hence java code is platform independent- "write somewhere, run anywhere". Its JVM which interprets the byte code into the machine language format of the platform on which it is running.
     The same byte code can be run on any platform, if the JVM for that platform is available.
The JVMs for all platforms are available free (http://java.sun.com/) and hence we say that the byte code runs in all platforms.


0 comments:

Feeds Comments

Please give your valuable comments.