Hi,
Wanted to know what is JVM in java?
Hi,
Wanted to know what is JVM in java?
JVM (Java Virtual Machine): A Java runtime environment, required for the running of Java programs, which includes a Java interpreter. A different JVM is required for each unique operating system (Linux, OS/2, Windows 98, etc.), but any JVM can run the same version of a Java program.
The Java virtual machine executes instructions that a Java compiler generates.
Java Virtual Machine is the base for the Java platform and is ported onto various hardware-based platforms. Every Java interpreter, whether it's a development tool or a Web browser that can run applets, is an implementation of the Java VM.
The Java virtual machine has n knowledge of the Java programming language. It understands a particular binary format, the class file format. A class file contains Java virtual machine instructions (or byte-codes) and a symbol table and other supportive information. JVM imposes strong security by having format and structural constraints on a class file. This leads to an interesting outcome: any language with functionality that can be expressed in terms of a valid class file can be hosted by the Java virtual machine.
Role of JVM
A) Loading of class files.
B) Verification of class files i.e. Class files should contain valid bytecode.As java is strictly type check language.So syntax checking and either code is reachable or not will be checked at compile time.
C) Interpretation of byte code and then run the program.
when you compile your Java source code, the javac compiler produces platform independent 'byte code'. Unlike a C compiler for example which will produce code that is native to the hardware of the platform you compile on, the Java byte code is platform independent and can be executed on any platform where you have a JVM available/installed. The JVM interprets the byte code and executes it on that platform, in some cases (like with Sun HotSpot in the Sun JVMs) compiling the byte code at run time on the fly into native platform code as a performance optimization.
Well its a software component of java execution system. You might be aware that java is a platform independent language..meant software written in java can be run on any computer machine with any operating system running on it. Suppose assume that you have written a source code on windows machine and wanna run it on linux machine.. when while running it on a linux machine the JVM(java virtual machine) comes into picture and interprets, executes your code on native(target) machine. JVM makes java platform independent.. hope you got. Remember JVM is platform specific... mean to say there is a specific JVM for windows, linux, mac etc.
give me that ans i want to know
Java virtual machine(JVM) is a specification , that is given by Sun Microsystem .
Specification refers set of instructions such as :
>what is the class format
>how a class should be load
>memory management
>garbagecollection
.....etc.
Now its specification is implemented by JRE
JDK=jre + java tools...
If any doubt .....Plz revert me.
Thanks !
Bookmarks