First, let's have a clear idea of the following members
Javac is a Java compiler. Composes Java code in Bytecode
JVM - Java Virtual Machine - Runs / interprets / translates Bytecode into native machine code
JIT is a Just In Time compiler. Compiles a given sequence of byte code instructions for machine code at run time before executing it initially. The main goal is to make a big performance optimization.
So, let's find the answers to your questions.
1) JVM: is it a compiler or an interpreter? - Ans: Interpreter
2) what about JIT compiler that exist inside the JVM? - Ans: If you read this answer in full, you probably know it now
3) what exactly is the JVM? - Ans:
- JVM is a virtual platform that resides in your RAM.
- Its class loader component loads the
.class file into RAM - The Verifier bytecode component in the JVM checks for any access restriction violations in your code. (This is one of the main reasons for Java security)
- The Execution Engine then converts the Bytecode into executable machine code.
Hope this helps you.
Srikanth Bandaru Feb 05 '13 at 13:26 2013-02-05 13:26
source share