Determining the current values of PATH and CLASSPATH
Unix
Type these commands in a command window:
echo $PATH
echo $CLASSPATH
If you get a blank command line in response to either of these, then that particular variable has no value (it has not yet been set).
Windows
Type these commands in a command window:
echo %PATH%
echo %CLASSPATH%
If you get the message "echo is on" for either of these, then that particular variable has no value (it has not yet been set).
Changing PATH and CLASSPATH
Windows 98
First, try the instructions for "Other Versions of Windows." If you are able to set PATH via the System window, great! Otherwise, you will need to modify a line of text in the c:\autoexec.bat file and restart your computer.
- Start Notepad (Start > Program Files > Accessories > Notepad)
- Open c:\autoexec.bat (File > Open, change to the c: folder and look for and open autoexec.bat. If you don't find one, create one.)
- You might find one or more than one line that starts with "set path". Look for one.
- If you do not find any lines starting with "set path", then add this new line to the end of the autoexec.bat file:
set path=c:\j2sdk1.4.1_01\bin
(This assumes that you really do have such a folder after you installed Java SDK 1.4. Please verify as needed.)
- If you already have one or more lines starting with "set path", go to the last one. If it does not currently include "c:\j2sdk1.4.1_01\bin", then add a semicolon to the righthand end of the "set path" expression and then add this:
c:\j2sdk1.4.1_01\bin
- Save the changes to autoexec.bat.
- You might find one or more than on line that starts with "set classpath". Look for one.
- If you do not find any lines starting with "set classpath", exit Notepad and any other programs and restart your computer. Try the java and javac commands again to see if they work now. You can ignore the remaining instructions below.
- If you already have one or more lines starting with "set classpath", go to the last one. Add this to the righthand end of the "set classpath" expression:
;.
- Save the changes to autoexec.bat, exit Notepad and any other programs and restart your computer. Try the java and javac commands again.
Other versions of Windows
- Start your System panel (Start > Settings > Control Panel > System).
- If you see Advanced or Environment, click those. (If you do not, follow the autoexec.bat instructions for Windows 95 users, above.)There are two windows on this panel: System variables and User variables. Check whether you have a Set button or a New button.
- If you see a Set button:
- If you see a New button and not a Set button:
No comments:
Post a Comment