To make it more convenient add the following classpath in the
startup file on your OS. For example, autoexec.bat on windows:
set CLASSPATH=.;c:\jdk\lib\tools.jar;%CLASSPATH%
Having done so you need to only restart your pc once.
This will ensure all your programs run. You can check
the current classpath by running SET at command prompt.
In case, you like the command prompt you can run using:
java -classpath yourclasspath ApplnClass
Now, all you need to do is compile your .java file and run it.