Setting Package's Classpath

Package can be imported in any program if that package in the same directory. If we try to import some packages which are in some different directory in different place then import statement cause an error because compiler won't find the imported package.

In order to import any package, path of that package need to be specified in CLASSPATH environment variable.

Temporarily it can be set on command prompt by writing following command

Command :

   set CLASSPATH=<package_path>

For setting it permanently we have to create one environment variable with name "CLASSPATH".