Java Reference
In-Depth Information
Enter
Classpath
in the Variable Name field and the correct value for your
Classpath
in
the Variable Value field.
For example, if you installed the kit in
c:\Program Files\Java\jdk1.6.0
, your
Classpath
should contain the following:
.;C:\”Program Files”\Java\jdk1.6.0\lib\tools.jar
Figure A.14 shows how I set up
Classpath
for my system, which has the kit installed in
C:\jdk1.6.0
FIGURE A.14
Setting up a
Classpath
in
Windows XP.
After setting up your
Classpath
, click OK twice: once to close the Edit or New System
Variable dialog box and another time to close the Environment Variables dialog box.
Unlike Windows 98 and Me users, you don't have to reboot the system before you can
try it out. Open a new command-line window and type the command
java -version
.
If it displays the correct version of the kit, your system might be configured correctly
and require no more adjustments. Try creating the sample
HelloUser
program again—it
should work after the
CLASSPATH
variable has been set up correctly
Troubleshooting Your Kit Installation
This topic has a website where you can find solutions to problems, corrections, answers
to reader questions, and other useful material; go to
http://www.java21days.com.
If you are still having problems with the Java Development Kit, an online version of this
appendix is available on the site.