Java Reference
In-Depth Information
computers? You'd need a compiler that generates different machine language output
for each of them. The designers of Java decided to use a different approach. They
cared a lot about their programs being able to run on many different computers,
because they wanted to create a language that worked well for the Web.
Instead of compiling into machine language, Java programs compile into what are
known as Java bytecodes. One set of bytecodes can execute on many different
machines. These bytecodes represent an intermediate level: They aren't quite as high-
level as Java or as low-level as machine language. In fact, they are the machine lan-
guage of a theoretical computer known as the Java Virtual Machine (JVM).
Java Virtual Machine (JVM)
A theoretical computer whose machine language is the set of Java bytecodes.
A JVM isn't an actual machine, but it's similar to one. When we compile pro-
grams to this level, there isn't much work remaining to turn the Java bytecodes into
actual machine instructions.
To actually execute a Java program, you need another program that will execute
the Java bytecodes. Such programs are known generically as Java runtimes, and the
standard environment distributed by Sun Microsystems is known as the Java Runtime
Environment (JRE).
Java Runtime
A program that executes compiled Java bytecodes.
Most people have Java runtimes on their computers, even if they don't know about
them. For example, Apple's Mac OS X includes a Java runtime, and many Windows
applications install a Java runtime.
Why Java?
When Sun Microsystems released Java in 1995, they published a document called a
“white paper” describing their new programming language. Perhaps the key sentence
from that paper is the following:
Java: A simple, object-oriented, network-savvy, interpreted, robust, secure,
architecture neutral, portable, high-performance, multithreaded, dynamic
language. 2
This sentence covers many of the reasons why Java is a good introductory pro-
gramming language. For starters, Java is reasonably simple for beginners to learn,
and it embraces object-oriented programming, a style of writing programs that has
been shown to be very successful for creating large and complex software systems.
2 http://java.sun.com/docs/overviews/java/java-overview-1.html
 
Search WWH ::




Custom Search