Why the Java language can cross-platform

Source: Internet
Author: User

Reference 51660015

Since the code compiled by the Java program is not code that can be run directly by the hardware system, it is an " intermediate code "- bytecode. Then different hardware platforms are equipped with different Java Virtual machines (JVMS), the JVM to "translate" the bytecode into the corresponding hardware platform to execute the code (machine code).

So for Java programmers, there is no need to consider what the hardware platform is. So Java can be cross-platform. because it has a virtual machine (JVM), Java programs do not run directly on the computer, but on the virtual machine, each system platform has its own virtual machine (JVM), so the Java language can cross the platform.
The compiler is a class file that compiles Java files into binary bytecode, and the JVM interprets the execution class file.
Because Java is running on the JVM, its code can be run without modification on the JVM of the different platforms (Unix-Unix JVM, Linux-Linux JVM, Windows-based JVM)
If you are porting to UNIX with Windows, simply translate the Java file into a class file on the UNIX JVM creates Macintosh and then run it with the JVM.



Why Java can cross-platform
Java can cross the platform because Java virtual functions cross-platform.

Why the Java language can cross-platform

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.