Java cross-platform principles and java

Source: Internet
Author: User

Java cross-platform principles and java

First, briefly explain the features of Java cross-platform, it is equivalent to writing a Java program that can run on different operating system platforms (Here we simply regard the platform as an operating system platform ). Here are some examples to illustrate its benefits.

First, let's take a look at some basic knowledge. The computer consists of hardware and software, and the software is divided into system software and application software. Install system software on the hardware, install application software on the system software, and check whether the software is compatible with each other, as shown in Figure 3-1:

 

(Figure 3-1)

 

For software compatibility issues, see the following example (Figure 3-2 ):

 

(Figure 3-2)

 

We often see this picture when downloading software. Imagine if you can use an Android mobile phone to download an Apple version of Xiaomi software, can you install and run it properly? Of course not. In this case, we can understand that, in order to meet the needs of users of different operating systems to develop different versions of the small memory software, the workload is obviously great. It would be nice to develop a set of small middleware software that can directly run on different operating systems!

The principles of cross-platform Java are as follows:

① Install one JVM (Java Virtual Machine) software on different operating systems;

② Compile the Java source file (. java file) into a bytecode file (. class file );

③ Load the bytecode file to the JVM for running. No matter what operating system is the same, as long as the Java Runtime Environment is installed;

④ Note: The JVM itself is also software, so we need to develop different versions of JVM for different operating systems, but this does not need to worry about our program, because the Java team already provides many mainstream operating systems to support JVM.

 

 

To sum up, Java indirectly implements its cross-platform features through JVM (Java Virtual Machine.

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.