I have a huge confusion between these two terms,atlast I had to post it here. Please explain me what are it's actual uses,what is the difference between them,and how should I set it and where should I set it.
I encountered this problem when I was trying to enable the assertions in the package level,and it was not able to find my classes.
PATH is an environment variable used by several different operating systems (both Windows and UNIX) to find program files (*.EXE files.) It always consists of a list of directories. If you type, say, WINWORD.EXE, the OS looks in each directory named on the PATH to find this program file.
Note that PATH has nothing to do with Java, except that the OS will use the PATH to find JAVA.EXE and JAVAC.EXE, etc.
CLASSPATH is an environment variable used by Java (and only by Java) to find .class files. It is a list of directories and/or .jar files that contain classes. When Java needs to load a class, it will look in all the locations named by the CLASSPATH.
Note that the OS has absolutely no use for CLASSPATH and couldn't care less what you've set it to (or not.)