Datasheet
4
Part I ✦ Introduction
Java brought the concept of a virtual machine into the mainstream. Traditionally,
programs written in a particular language, such as C, were compiled directly for
the operating system on which the program would run. In order for companies to
support multiple-target runtime environments, a new build environment became
necessary for each target — for example, Windows95, HP-UX, Solaris, and so on.
However, Java is not compiled completely, but instead is compiled to an intermedi-
ary stage as Java bytecodes. At runtime, the Java bytecodes are executed within a
virtual machine, which is a piece of software that interprets the bytecodes in run-
time into the native binary for the operating system.
The virtual machine is responsible for allocating and releasing memory, ensuring
security, and optimizing the execution of the Java bytecodes, among other functions.
This has indeed created a new market simply for virtual machines for various oper-
ating systems. As long as a virtual machine is available for a particular operating
system, the Java bytecodes should be able to be executed on it, assuming that all
the Java APIs are implemented. Figure 1-1 shows the stages that Java code must go
through before being executed on a target machine.
Figure 1-1: Java Virtual Machine compilation
* Not all APIs shown
Web container
Web
components
Web container
JMS
JNDI
Java
Mail
JAAS
RMI_IIOP
JMX
XML-RPC
JDBC
EJB
components
EJB container
App container
Applets
Apps
c539663 ch01.qxd 7/25/03 9:13 AM Page 4