Two core mechanisms: Java Virtual machine, garbage collection mechanism.
Java program running process: source files-Through the Java compiler-generated bytecode file class file---Class loader-bytecode Checker---Interpreter-operating system platform,
On the operating system, there is a set of environment for compiling and executing Java---then handing it over to the operating system platform---then translating it into a part that the machine can recognize.
The upper layer of the operating system also has an environment that is compiled and executed for Java, a virtual machine called java. A virtual machine, the Java Virtual machine can be understood as a byte-code machine instruction CPU.
For different platforms, there are different virtual machines
The Java Virtual machine mechanism masks the differences of the underlying platform, enabling a single compilation and running Anywhere
Java files---compiled--CALSS files---executed on different platforms of Java virtual machines
For Java to see the bottom of the operating system, but in the virtual environment to execute
Compiling and Interpreting:
Compilation: C and C + + can be compiled directly into the format of executable files that the operating system can recognize.
Java was first compiled into Java's own executable file. class, when the real class file is in the process of executing, he needs the Java virtual machine to take out the class
The code to one line of explanation, take a line I will translate him into the operating system platform can directly understand the format of the executable file, so, the real implementation process, Java is
A row of rows explains the execution of the
Garbage collection mechanism, every time, the unified garbage collection once
JDK Java Software Development Kit
The JRE Java Runtime Environment contains the JRE, which is the virtual machine
Java program running mechanism and running process