Java Reference
In-Depth Information
Table 1-5 Java 2 Standard Edition Components
JAVA 2 STANDARD EDITION (J2SE) COMPONENTS
Java Standard Development Kit (SDK)
• Java Compiler
• Java Debugger
• Other Tools
Java 2 Runtime Environment (JRE)
• Java Virtual Machine (JVM)
• Java APIs and Class Libraries
• Java Applet Viewer
• Other Tools
J ava 2
J ava 2
v 5 . 0
JAVA UPDATE
v 5 . 0
There are many reasons
to upgrade to Java 5.0.
The new version is
completely backward
compatible, which
means your old pro-
grams will work in Ver-
sion 5.0 without any
changes. Version 5.0
has improved perfor-
mance, advanced
monitoring and man-
ageability, and runs
faster than previous
versions. With im-
proved error checking
capability and
enhanced looping,
developers in Version
5.0 will spend less time
writing and testing
their code.
The Java Compiler
A compiler is a program that converts a programmer's code into machine-
readable instructions. A compiler is like a person who translates large portions of
written text; he or she has the luxury of being able to read the entire text to see
how it all fits together during translation. A compiler looks at the entire source
code during compilation, searching for errors and inconsistencies with what it
knows from other parts of the program. The Java compiler, which is imple-
mented with a program called javac.exe, converts the source code for the entire
Java program into object code called bytecode (Figure 1-21). The Java compiler
is part of the Java SDK.
The Java Virtual Machine
Once the source code is compiled into bytecode, the same bytecode can be
run on any computer as long as the computer has an interpreter to execute the
Java bytecode. An interpreter is a program that executes the machine language
instructions to produce results, or answers. An interpreter is like a person who
translates orally and dynamically, one sentence at a time, knowing what has been
said previously but knowing nothing about future statements.
The language interpreter for Java is included as part of the Java Virtual
Machine ( JVM ). Execution of Java programs is initiated with the java.exe com-
mand; the JVM then interprets or attempts to run commands from the bytecode,
one command at a time. For example, once a program is compiled to bytecode,
the JVM on any platform — whether Windows, UNIX, or a cell phone — inter-
prets the bytecode (Figure 1-21). The Java Virtual Machine is part of the JRE.
The Java API
The JRE also includes a set of Java application program interfaces, or APIs.
An application program interface ( API ) is a standard set of interfaces and
classes functionally grouped into packages; these APIs are present in any Java
implementation. The APIs contain hundreds of pre-written classes that fall into
one of more than 50 predefined class packages. Class packages , also called class
libraries , are accessible by every Java program. By using methods and variables
 
Search WWH ::




Custom Search