1, Java cross-platform, refers to Java at runtime is above the OS, is running in the JVM, and the OS is not directly linked.
2, Java cross-platform is mainly determined by the Java compilation method, because Java is compiled and executed by the JVM, it compiles the. class file is the underlying implementation is not for the operating system, so what operating system does not affect the implementation of Java code.
3. To run a Java program, you must install the JDK (Java Development Kit), different systems need to have different JDK. Since there is a JVM (virtual machine) inside the JDK, it is possible to convert our original files into machine language that the machine can eventually recognize. Virtual machine It is actually a simulation machine that is realized by means of the device and other functions of the computer itself.
4. How does a virtual machine turn our original file into a machine-readable language?
First, we write the source program (extension. java), the virtual machine through the JDK "Javac.exe" This program, you can convert our source program into a Java Word decoder (extension. Class).
Secondly, after the conversion to the self-decoding program, through the "Java.exe" program, the self-decoding program can be implemented under the corresponding operating system Java self-decoding interpretation. The machine-readable language is implemented through the operating system.
It is important to note that not all systems are capable of running Java. Because if the Java self-decoder is not installed on this operating system, then the Java language cannot be run on this platform.
How to understand the cross-platform features of Java