A Learning Journey

–By Sharing Knowledge

CHAPTER-III: About ‘Path’ and ‘Classpath’

Posted by krishnamm on February 9, 2009



In Previous chapter, we have discussed about path and classpath…but what is this path and classpath and why we need to set these variables. what is thier role?? we have to learn that…

What is path?

An environment variable that lists the directories the command processor searches for *.exe.

If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as:

C:\Program Files\Java\jdk1.6.0\bin\javac MyClass.java

What is classpath?

The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.)

 The default value of the class path is “.”, meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.

To set classpath, the process is: MyComputer –>(right click): properties –>Advanced –> Environmental variables . You can create classpath variable or modify if already.

same thing for path setting as well.

You will get more info regarding path and classpath in below link.




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: