Java platform dialysis
First, what is the Java platform?
Nowadays, there are a variety of operational platforms in the computer world. In many operational platforms such as Microsoft Windows, Macintosh, OS / 2, UNIX, and NetWare, software must be compiled separately on each platform. A binary of an application running on a platform cannot be run on another other platform because this binary is based on a special machine code.
The Java platform is a new type of software platform that can be used to publish and run high interaction, dynamic, secure Java Applets and Applications (Applications) in the network computer system. However, another Java platform seems to have advantages over other operands, which is located on them, compiles the application into a zona code, which is not specific to any machine encoding, but is a so-called Java virtual machine generates a machine instruction set. Programs written with Java can be compiled into a zona-code file, which can be run on any underlying operating system with a Java platform. That is, the same compilation file can run on any operating system running the Java platform. Because the core of the Java platform is a Java virtual machine mechanism, this portability becomes possible.
Although each underlying platform has its own implementation methods for Java virtual machines, there is only one Java virtual machine specification. Because of this, the Java platform can provide a standard, unified programming interface for Applets and Applications running on any hardware. Therefore, the Java platform is an ideal solution for the Internet. On the Internet, a program should have the ability to run in any computer in the world. The Java platform is designed to provide such a capability: "Compiling once, you can run anywhere" ("Write Once, Run Anywhere").
Developers use Java language to write powerful Java application source code. They are compiled once on the Java platform instead of the underlying system. The Java source code is compiled into an intermediate, portable bytecode, and then runs on any place with a Java platform.
Developers can write object-oriented, multi-threaded, dynamic link applications with Java languages. The Java platform has built-in security, violation processing, and automatic garbage collection mechanism. When converting the Java bytecode into a machine language, the instant compiler can accelerate the running speed. In order to achieve faster speed or other special functions, developers can also write or call local methods from Java language in Java language - C, C or other languages, in a special underwaters Compiled method.
The Java language is a channel to enter the Java platform. Programs written and compiled with Java language can run on the Java platform.
The Java platform has two basic components:
• Java virtual machine
• Java application interface (Java API)
They will be described in detail in subsequent chapters. The combination of these two parts provides the operating environment for end users to develop Internet and intranet applications.
Second, Java basic platform
The Java Basic Platform is a micro platform that developers can perform safe applications, currently used to run high-performance Java Applets and Application. This platform is applied to network computers, desktops, and workstations (next section to describe a platform for smaller systems). It includes a Java virtual machine as mentioned earlier, but has a small Java API (application interface) that runs basic Java applets and applications (Applications). It is well known that this small API is a Java Applet API or a basic Java application API. Developers who have coding work on this small API, the developer who can be assured is that the developed program on this basis can also run anywhere without the support of additional libraries. . A specific Java platform operation license has agreed to include the basic Java API in their personal Java platform application implementation. As more Java class development, the Java foundation platform will grow, these additional class libraries will be added to the Java foundation platform in a timely manner and present on the operating system of each licensed user.
Another application interface (APIS) called standard expansion API is developed by JavaSoft and other major companies that lead the industry to expand the basic functions of the platform. Over time, some standard expansion APIs will be added to the Java foundation platform.
Third, inline Java platform
The goal of embedded Java platforms is for some consumer equipment, such as consumption equipment such as top boxes, printers, copiers, and mobile phones require less resources and more personalized features than network computers. These devices themselves have small storage space, no display screens or limitations that cannot be connected to the network.
Application Interface (API) for this platform is called Java embedded API, which is a minimum set of Java APIs, which can be used and run on embedded devices that require less function. Since this platform is still in development, this API has not achieved a standard degree. Therefore, the API still has not been formulated, but it is generally composed of two packets of java.lang and java.util. A Java application written for a special device can run on most similar dedicated devices.
Fourth, the benefits of the Java platform
The Java platform is beneficial to end users and developers, and the supporters are as follows:
End users benefit
Now, the Java platform provides vivid and interacting on the Global Internet through instant software. Java applications can run immediately in all operating systems. On this basis, users have already liberated from the work of the operating system. Smaller, low-priced special systems will eventually have their own applications.
Developer benefits
The Java language is a small, easy to learn language system, accompanied by a more and more comprehensive APIS. Developers can "compile once, run anywhere", this is a huge market advantage over other languages for Java languages. Moreover, the Java development environment on all operating systems, just compiles files into a single binary format. Now, developers can develop, save, released on the same platform, and then run on all platforms, without being developed on a variety of platforms, and released on each platform. Java's ability to "compile once, run in any place", for some developers as a replacement of C or C , and then to Java, providing sufficient reasons, even for independent, non-network s application.
Moreover, through distribution, reusable setup application, it can make developers to concentrate on new things, which greatly reduces development costs. Developers can distribute development through the network without having to complete work in the rooms that are dedicated to software development. V. Java platform internal exploration
The Java platform is divided into two main parts: Java virtual machine and Java APIS, as shown in Figure 2:
• Java Virtual Machine - Java Virtual Machine is a "soft" computer that can be implemented on software or hardware. It is an abstract machine that is designed to process Java programs before existing processors. The ports of the interface and adapters allow it to easily access into new operating systems without having to completely rewritten.
• Java API - Java API provides standard interfaces for Applets and applications, whether they are running on what operating systems. The Java API is the basic framework for the application development environment. The API stipulates a basic interface that developers will use these interfaces to perform Java application programming in an increasing major area.
- Java Basic API provides a very basic language, application, I / O, network, GUI, and Applets services; OS, licensed Java, has agreed to include the above functions in their deployment Java platform.
--Java Standard Extended API extends some of Java's features outside the basic API. Some of these extensions will eventually be fused into the Java Basic API. Other non-standard extension APIs can have Applets, applications, or underlying operating systems. With the release of each new expansion API specification, the entire industry will deliver and give feedback before it is finalized.
In the above figure, the Java foundation platform is part of the black display, including those identified by the Adapter. The Java API includes Java Basic API and Java Standard Extended APIs. Class is the implementation of the API. The Java virtual machine is the core of the entire platform. The port of the interface is located between the Java virtual machine and the operating system or browser. The port of the interface has two parts, part of the platform (shown in the black portion in the figure); another part depends on the platform, as shown in the figure. The operating system and Java operating system provide windows, documents, and network functions. Different machines can be interconnected through the network, as shown in the figure.
The Java API framework is open and scalable. The specification of each interface is developed by experts from the entire industry. The newly developed specifications will be publicly published and modified to the entire industry. The API specification can be achieved for other companies in JavaSoft and the entire industry. In today's rapidly developed environments, the Java API framework allows the existence of its innovation development, and the Java platform can be expanded.
The API is organized in groups or complete forms. Each set of APIs can be handled as one or more packages (namespace). Each package is organized together with some classes or interfaces to define a set of related domains, constructors, and methods.
6. Java virtual machine
The Java virtual machine is a key to the program and the underlying operating system and hardware - it is a platform that separates Java Applets and applications to the underlying operating system. It is very easy to access a browser or other operating system through a virtual machine. Moreover, the virtual machine defines a binary file format that is not related to the machine. This format stores a set of instructions for operating a virtual computer in the form of a field code. The bytecode representing any Java language program is a symbol that indicates that the index and offset of the method are not a constant value. Conversely, it is given as a character name as a character name. When the method is first called, the first is to find it through the name of the method in the class file. In order to find this method in the future lookup, the value of its offset is determined at this time. Thus, any new or basic method can be introduced anywhere in the class framework later. It will be able to symbolize the correct introduction without chaos. The bytecode is the advanced representation of the program, so that the program optimization and the generation of machine code (through instant compiler) can be done at this level. Moreover, since the virtual machine is stored in the address space of the Java platform in the stack, garbage recovery processing can be performed in the inside of the virtual machine. Seven, Java compile and operate the environment
The Java language development environment includes both compiled and runtime environments, as shown in Figure 3:
The runtime environment represents a Java platform. Developers write Java source code (.java files), then compile it into a zona code (.class file). These bytecodes are a set of instructions for operating a Java virtual machine. In order to create an applet, the developer stores these bytecode files on the HTTP server, add such a label in the web page: