Tuesday, November 8, 2011

JVM

JVM - short for Java Virtual Machine.
Its the biggest buzzword in Java - and also its raison-de-etre.

When you create an executable for a C/C++ program, you have to target the OS - you have to have a different executable for Windows/Linux/Mac

Java source compiles into byte-code - which is always targeted for ONE virtual OS - aka JVM. It is the virtual environment in which all Java programs run - they are unaware of the actual OS they are running on. JVM is the abstract container which shields Java programs from underlying OS.

When you start the JRE (by running java.exe), it first creates a JVM - then runs your Java program in this JVM. If you have 5 (or n) java.exe processes running, you have 5 (or n) JVMs running.

Each Java program executes inside its own JVM.

No comments: