Setting the PATH and CLASSPATH in Windows XP
Setting the Path Variable
-
Open Control Panel.
-
Open system and click the advanced tab.
-
Choose Environment Variables button
-
Highlight Path and click 'Edit'
-
At the beginning of anything that is already there, add in C:\Program Files\Java\jdk1.5.0_02\bin; (If you installed Java somewhere else, you will need to point to the folder where your java.exe and javac.exe files are stored.)
Setting the Classpath
Now you have to create a new variable, called your CLASSPATH.
-
Click on the "NEW" button below the top window.
-
Under 'variable name' type CLASSPATH
-
Under 'variable value' type . (yes, type a single full stop).
-
Click OK.
-
Restart your computer.
Test your installation by opening up a command window and verifying that both the commands "java" and "javac" are recognized.
Setting Path and Classpath in Windows 98
In Windows 98, you can modify your autoexec.bat file
Start Notepad and open c:\autoexec.bat. Type in or edit the following lines:
set PATH=%PATH%;C:\Program Files\Java\jdk1.5.0_02\bin;
set CLASSPATH=.
Save and exit notepad.

