Java Virtual machines and cross-platform principles

Source: Internet
Author: User

Java Virtual machines and cross-platform principles

Java Virtual Machine (JVM) is an imaginary computer that can run Java bytecode, and the cross-platform of Java is relative to other programming languages, use C programming and execution to compare Java programming and execution processes:



as with C, the Java source program is first written and then compiled by the Java compiler into the JVM executable code, Java bytecode, Java source The bytecode file generated after the compilation is equivalent to the EXE executable file on Windows compiled by the C source program, which is equivalent to the computer system (OS + hardware environment), an EXE file is running on Windows, and the JVM is running a Java bytecode file (. class file).

the process for Windows to execute an EXE executable file is to remove the computer instructions from the EXE file and give it to the CPU to interpret the execution. JVM executes Java bytecode process, and the JVM takes a byte code from the bytecode file to the CPU to execute. The CPU that executes the Java bytecode can be either hardware or is a software that runs on a system called the Java bytecode interpreter (that is, the JVM).


Summarize:

Interpreter = "CPU" of the JVM

The ①.exe file runs directly under the Windows operating system, which is the machine code that runs on the CPU.

The ②.class bytecode file is run under the JVM virtual machine, which is the Java bytecode that is running on the interpreter.

③ What is a program, the so-called Java compiler is the Java compiler (Javac.exe in the bin directory of the JDK), the Java interpreter is a specific platform under the interpreter (Java.exe in the bin directory of the JDK).

④ as long as the implementation of the specific platform of the interpreter, Java bytecode can be run through the interpreter program under the platform, which is the root of the Java cross-platform.

Java Virtual machines and cross-platform principles

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.