JVM

Python can execute raw code. This means it is a virtual machine that actively translate machine-independent python code into machine-dependent byte code in run time. Python choose to ship machine-independent human readable code, but Java choose to ship machine-independent bytecode for the following reasons: - bytecode is smaller than source code - bytecode is harder to reverse engineer than source code - bytecode is harder to modify than source code - JVM does not need to have a compiler (reduce footprint) - compile once, and run everywhere

Virtual Machine: a virtualization on CPU

Distributing Java's Bytecode to Different Platform

Distributing Java's Bytecode to Different Platform

Java Virtual Machine (JVM): parse Java's machine-independent byte code.

Java made the decision to ship machine-independent is to avoid re-compilation for different platforms. However, it requires the user to at least install machine-dependent JRE.

JRE and JDK

JRE and JDK

Java Runtime Environment: just a java virtual machine, used to run .class bytecode

Java Development Kit: superset of JRE, including Java compiler, debugger, and many developing tool for debugging purposes.

Java provides Java Virtual Machine Specification and in theory you can make your own JVM. There are many JVMs in the market.

Table of Content