For Windows?
You probably want to set the
path variable to include the bin folder of the JDK, and set the
classpath variable to include your programs.
The path never changes (unless you want to switch between JDKs) so it's safe to set it in the system. In Windows, start / settings / control panel / system / advanced / environment variables button. Then add the full path to the bin directory to the path.
I change the classpath often depending on the program I'm running. I often have a batch file just for one program that adds the necessary jars and other projects I'm working with. For simple exercise programs, it may be enough to have "." in the classpath for current directory, so make sure the "." is in the system defined classpath.
See if
this tutorial makes things clearer or worse. Follow the link at the beginning to Sun's setup pages.
[ July 18, 2007: Message edited by: Stan James ]