Java Reference
In-Depth Information
Edit the computer's
PATH
variable and add a reference to the kit's
bin
folder (which
is
C:\Program Files\Java\jdk1.6.0\bin
if you installed the kit into the
C:\Program Files\Java\jdk1.6.0
folder).
n
Edit or create a
CLASSPATH
variable so that it contains a reference to the current
folder—a period character and semicolon (“
.;
” without the quotation marks)—
followed by a reference to the
tools.jar
file in the kit's
lib
folder (which is
C:\Program Files\Java\jdk1.6.0\lib\tools.jar
if the kit was installed into
C:\Program Files\Java\jdk1.6.0
).
n
For inexperienced MS-DOS users, the following section covers in detail how to set the
PATH
and
CLASSPATH
variables on a Windows system.
Users of other operating systems should follow the instructions provided by Sun on its
Java Development Kit download page.
Using a Command-line Interface
The kit requires the use of a command line to compile Java programs, run them, and han-
dle other tasks.
A command line is a way to operate a computer entirely by typing commands at your
keyboard, rather than by using a mouse. Very few programs designed for Windows users
require the command line today.
To get to a command line in Windows, do the following:
n
NOTE
On Windows 98 or Me, choose Start, Programs, and then
choose MS-DOS Prompt.
On Windows NT or 2000, choose Start, Programs,
Accessories, and then choose Command Prompt.
n
On Windows XP or Windows Server 2003, choose Start, All
Programs, Accessories, and then choose Command Prompt.
n
When you open a command line in Windows, a new window opens in which you can
type commands.
The command line in Windows uses commands adopted from MS-DOS, the Microsoft
operating system that preceded Windows. MS-DOS supports the same functions as
Windows—copying, moving, and deleting files and folders; running programs; scanning
and repairing a hard drive; formatting a floppy disk; and so on. Figure A.2 shows a
command-line window.