1. First of all, what is Cross-platform
is that the same Java file can run on a different operating system
2. Look at a picture first
1.class file generation, Java file compiled programming class file,
2. Files running on virtual machines;. class files are files that can be run on virtual machines (no compiled Java files cannot run)
3.JVM is just an application; The JVM can be understood to be the same as our QQ program, which is the operating system application
4. Three different operating systems, as shown in figure: there are three different operating systems, respectively, Windows systems. Linux systems. UNIX systems
5. Different JVMs on the operating system; the JVM installed in each operating system is different, as our QQ is installed on Apple's MAC system and Windows system, and there are different version numbers;
3. Summary:
Our Java files are the same, The. class file that we compile can also be seen as the same, the cross-platform nature of Java (the features that Java can run on different operating systems) is the result of different JVMs, and different JVMs are responsible for getting the same. class files and communicating with their respective operating systems, as if the country's diplomats, the state, have the same documents. Need to communicate with Britain, France, Japan and other countries, the state as long as the document issued to different countries in the hands of diplomats, then in different countries of the diplomatic staff in charge of communication with different countries. To reach the point of communication.