Friday, August 2, 2013

3.JAVA VIRTUAL MACHINE


Before we understand Java Virtual Machine, We will see Compiling and Linking process in C.


Here in the above figure, you can easily understand how compiling and linking process works in C language.I hope diagram itself is self explanatory..

Okay now where this a.exe gonna store....Obviously its gonna store in RAM as shown in below.

  It will store in RAM and starts execution.

Okay now coming to our part JAVA...There is no linking done in JAVA....See the image below..



Note: Class file which contains bytecode(intermediate code that is before machine code).

JVM (JAVA VIRTUAL MACHINE) Architecture :

 

JVM resides inside our RAM. There are three components inside our JVM.

1.CLASS LOADER

2.BYTE CODE VERIFIER

3.EXECUTION ENGINE

Class Loader Component loads class into the RAM. Byte Code Verifier for Security Purpose like checks whether there is stack underflow or overflow errors.And finally Execution Engine which contains Just In Time (JIT) Code Generator which is used to convert BYTECODE into native Machine Code and Starts its Execution. 

Difference Between JDK, JRE and JVM :

Many of the intermediate java programmers doesn't  know what exactly the difference between jdk,jre and jvm...Its very simple.

JDK is the acronym for Java Development kit.Inside JDK we are having JRE(Java Runtime Environment) and some Development tools.

JRE which contains some specific set of libraries and files.

JVM which we have already discussed which resides in JRE.


                                                         Next Chapter

No comments:

Post a Comment