There are 3 ways to set the classpath variable in WinNT/2000.
1 - Windows enviroment. In winnt it's control panel --> System --> Environment --> User variables, enter classpath in the Variable field and the value you want in the Value field. Win2k is similar but it is right-click on MyComputer --> Properties --> Advanced --> Environment Variables --> new. These settings will be passed to every command shell opened, in other words they are "permanent".
2 - Command shell. Type set classpath = value you want. These settings persist for the lifetime of the command shell. Note: %classpath% echo's the current setting. So
set classpath = %classpath%;newstuff
will append newstuff to the classpath.
3 - Command line. Include classpath as an argument to the utility you are employing.
Ex
java -classpath C:\jdk1.3 MyClass
These setting apply only to the current command and persist only as long as the command is running.
note:
seperate entries with ;
Ex
entry1;entry2
. refers to the current directory
Ex
entry1;.
The java utility, by default, uses the current directory setting ( . ), but if you specify your own classpath the default "." will be replaced with the classpath you specified, so you need to be sure "." is a part of the classpath you supply.
You shouldn't need to include the jdk1.3\bin directory in your classpath. So if all the files your program utilizes are either in the current directory or in jdk1.3\bin, you don't need to specify a classpath at all. Just navigate to the directory the intended file is in and invoke
java TheClassYouWantToRun
Of course you will need to specify a classpath when you try to compile.
[This message has been edited by Guy Reynolds (edited July 18, 2001).]