Friday, November 30, 2012

Path and Classpath


PATH is nothing but setting up an environment for operating system. Operating System will look in this PATH for executable.


Classpath is nothing but setting up the environment for Java. Java will use to find compiled classes (i.e. .class files).



Path refers to the system while classpath refers to the Developing Envornment.

We keep all "executable files"(like .exe files) and "batch files"(like .bat) in path variable. And we keep all jar files and class files in classpath variables.



For example,assume that Java is installed in C:\jdk1.5.0\ and your code is in C:\Sample\example.java, then your PATH and CLASSPATH should be set to:

PATH = C:\jdk1.5.0\bin;%PATH%

CLASSPATH = C:\Sample










ShareThis