| Contents | Prev | Next | The Java Platform |
A Java Language development environment includes both the compile-time and runtime environments, as shown in Figure 3. The Java Platform is represented by the runtime environment. The developer writes Java Language source code (.java files) and compiles it to bytecodes (.class files). These bytecodes are instructions for the Java Virtual Machine. To create an applet, the developer next stores these bytecode files on an HTTP server, and adds an <applet code=filename> tag to a Web page, which names the entry-point bytecode file. When an end user visits that page, the <applet> tag causes the bytecode files to be transported over the network from the server to the end user's browser in the Java Platform. At this end, the bytecodes are loaded into memory and then verified for security before they enter the Virtual Machine.
Once in the Virtual Machine, the bytecodes are interpreted by the Intepreter, or optionally turned into machine code by the just-in-time (JIT) code generator, known more commonly as the JIT Compiler. The Interpreter and JIT Compiler operate in the context of the runtime system (threads, memory, other system resources). Any classes from the Java Class Libraries (API) are dynamically loaded as needed by the applet.
Figure 3. Source code is compiled to bytecodes, which are executed at runtime.