Revisiting the JVM
The Virtual Machine (VM) concept wasn't something new when Java arrived back in 1995. Before that time, many other languages used VMs, though they weren't so popular among developers. Java architects decided to use VMs because they wanted a mechanism to create platform independence to improve developer productivity.
Before elaborating on the VM concept, let's first check what we can run inside a VM for Java. In languages such as C or C++, we compile source code into a native code tailored for a specific operating system and CPU architecture. When programming in Java, we compile the source code into bytecode. The JVM understands the instructions contained in bytecode.
The VM idea comes from a concept where it is possible to run programs in an intermediate or virtual environment sitting atop the real machine. In such an arrangement, the program does not need to communicate directly with the underlying operating system—the program deals only...