Java Reference
In-Depth Information
•
java
: a tool for running applications
•
javac
: a tool that launches the Java compiler to compile one ormore source
files
•
javadoc
: a tool that generates special HTML-based documentation from
Javadoc comments
The JDK's tools are run in a command-line environment. You establish this by
launching a command window (Windows) or shell (Linux/Solaris), which presents to
you a sequence of prompts for entering
commands
(program names and their argu-
ments).Forexample,acommandwindow(onWindowsplatforms)promptsyoutoenter
a command by presenting a drive letter and path combination (e.g.,
C:\
).
You respond to the prompt by typing the command, and then press the Return/
Enter key to tell the operating system to execute the command. For example,
javac
x.java
followedbyaReturn/Enterkeypresscausestheoperatingsystemtolaunchthe
javac
tool,andtopassthenameofthesourcefilebeingcompiled(
x.java
)tothis
toolasitscommand-lineargument.Ifyouspecifiedtheasterisk(
*
)wildcardcharacter,
asin
javac *.java
,
javac
wouldcompileallsourcefilesinthecurrentdirectory.
Tolearnmoreaboutworkingatthecommandline,checkoutWikipedia's“Command-
line interface” entry (
http://en.wikipedia.org/wiki/Command-
Another important subdirectory is
jre
, which stores the JDK's private copy of the
Java Runtime Environment (JRE). The JRE implements the Java platform, making it
possible to run Java programs. Users interested in running (but not developing) Java
programs would download the public JRE. Because the JDK contains its own copy of
the JRE, developers do not need to download and install the public JRE.
Note
JDK7comeswithexternaldocumentationthatincludesanextensivereference
to Java's many
APIs
(see
http://en.wikipedia.org/wiki/Applica-
tion_programming_interface
to learn about this term). You can download
the documentation archive from
http://www.oracle.com/technetwork/
java/javase/downloads/index-jsp-138363.html
so that you can view
this documentation offline. However, because the archive is fairly large, you might
prefer to view the documentation online at
http://download.oracle.com/