I have heard people saying "a JVM is necessarily a Java interpreter but a Java interpreter is not necessarily a JVM". Is that true?
I mean is there a difference between a Java interpreter and JVM?
interpreterjavaprogramming-languages
I have heard people saying "a JVM is necessarily a Java interpreter but a Java interpreter is not necessarily a JVM". Is that true?
I mean is there a difference between a Java interpreter and JVM?
Best Answer
Yes, there is a difference.
Java virtual machine:
A software "execution engine" that safely and compatibly executes the byte codes in Java class files on a microprocessor (whether in a computer or in another electronic device).
Java interpreter:
A module that alternately decodes and executes every statement in some body of code. The Java interpreter decodes and executes bytecode for the Java virtual machine.
The Java interpreter is actually a part of JVM. Virtual machine is not just executing the bytecodes, it has lot of tasks to do. That full-fledged environment is referred to as a JVM.
Check:
Java Virtual Machine
Java SE HotSpot at a Glance