hi to all I want to know the difference between setting path and classpath I use path for executing java files from a different folder but whats is the use of CLASSPATH then....pls give me a clear idea abt that ...many gave me different answers..
In short, PATH is used by the operating system to find executable files (.exe's in Windows) that it can run. CLASSPATH, on the other hand is specifically used by Java to find .class files that are needed when you run a Java program.
Setting the PATH variable allows you "to conveniently run the JDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command." To set the PATH, see these installation instructions for 32-bit Windows. (For other operating systems, click here.)
Setting the CLASSPATH variable "tells JDK tools and applications where to find third-party and user-defined classes." To set the CLASSPATH, see these JavaRanch instructions or Sun instructions.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org