Path
Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer. In Java to run any program we use java tool and for compile Java code use javac tool. All these tools are available in bin folder so we set path upto bin folder.
classpath
classpath variable is set for providing path of all Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.
Difference between path and classPath
path classpath
path variable is set for providing path for all java tools like java, javac, javap, javah, jar, appletviewer classpath variable is set for provide path of all java classes which is used in our application.