Setting Classpath

If you are able to compile java programs but not run java programs and you see a message similar to

Exception in thread main ........

Try setting your classpath variable.