Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

My understanding about JDK, JRE and JVM [closed]

Tags:

java

jvm

After my deep analysis this is how i have understand about JDK, JRE and JVM. Please correct me if i am wrong...

  1. JVM is subset of JRE, JRE is subset of JDK.
  2. JVM is used to convert the byte code (*.class) to object code(machine code) by using JRE.
  3. JRE has Operating System (OS) specify DLL which is used by JVM for byte code to object code conversion.
  4. If suppose tomorrow if any new OS will launch then the currently available JREs may not support the JVM for byte code to machine code conversion. So the JRE may required to enhance to support for the new upcoming OS.
  5. So from the above my analysis i am concluding like JVM is common for all OS but JRE has OS specific DLL which will be used by the JVM during byte code to object code conversion.
like image 703
Pandian Avatar asked Jan 22 '26 22:01

Pandian


1 Answers

JVM is virtual, you can think of it as a virtual computer whose machine code is the Java bytecode. It is not a real computer but a virtual one which can execute Java bytecode instructions.

JRE is the JVM implementation. The implementation is OS-specific (of course) but it provides OS-independent outer interface (meaning e.g. you can run same Java code on a Windows JRE and on a Linux JRE). This is the 'write-once-run-anywhere' thing from the late 90s.

JDK is the compiler, the JRE, other tools, and all Java APIs you need to write Java code.

I don't want to add Android and its Dalvik VM to the picture (though I can draw some interesting parallels), as I will confuse you more, I think.

like image 92
peter.petrov Avatar answered Jan 25 '26 10:01

peter.petrov