Java virtual machine model
Due to its highly portable, Java has become the primary programming language on the Internet.
The concept of "simulating machine" is one of the interpretations of the computer industry often use for virtual machines. This virtual machine concept is very different from the IBM version of the virtual machine. In the concept of IBM, system memory and resource are split and become an exact copy of the current machine. For simulators, the system is not split, but there is a new "machine" or virtual machine loaded into the current system, providing users with different functions without changing the current system. This type of virtual machine proves to be very powerful, which allows software developers to follow another machine on a completely different machine. Recently, this concept creates a powerful computer program language: Java.
The Java programming language depends on the simulation of Java Virtual Machine, JVMs. JVM makes the programmer not to deal with the system, but deal with the virtual machine. Therefore, the function used by the programmer is the function of the JVM, not a function of the operating system. This is very advanced because it provides portability. If the same JVM is installed on two completely different machines, then the same Java program should run on both machines, because the Java program depends on JVM instead of running its system. Due to its highly portable, Java has become the primary programming language on the Internet. Many web pages are now combined with Java programs. These Java programs can complete some tasks displayed in the browser.
At the same time, JVM is also very small. Or, it does not stand a lot of memory. This means that JVM can be applied to many different machines. For example, televisions, cellular mobile phones, and computers can. Therefore, it is entirely possible to add complex functions such as the game to the device that we are using today.
How did it work?
What you are doubtful now is how a Java program works. How to use JVM? Ok, JVM is our call to abstract computers. Or, JVM is implemented in the "real" hardware platform and operating system. The Java program is compiled for JVM instead of the system. This means that the programmer written by the Java program is translated into the language / code executed by the Java compiler. These codes are called byte codes. Byte code can be considered a JVM machine language. JVM interprets the byte code stream into instruction sequences. These instructions are then executed to generate desired outputs. Figure 1.1 shows the route from the Java program to the final execution.
As shown in Figure 1.1, once the byte code is explained by the JVM, the JVM instruction is mapped to an operating system instruction or hardware instruction. This means that the JVM actually uses the operating system and machine instruction to implement the instructions it get. Therefore, the JVM instruction must have a possible mapping to work on each of the operating systems or machines that install the JVM. This is why Java languages have not reached one of 100% transplantable reasons. The possible JVM instructions can be implemented on an operating system, and cannot be implemented on another operating system.
summary
The main purpose of the Java virtual machine is to solve the transplantable problem of the computer program. Is there a problem with the JVM completely solved this problem? The answer is not ... It does not completely solve this problem. However, it provides a solution to most of them (although not 100% is valid). Java has implemented considerable portability. The power of Java enables people to develop many cross-platform applications. Java has proven to be useful, powerful virtual machine implementation.