how to set the class path?-

my forlder is :C:\Documents and Settings\indiajdk is in:C:\Program Files\Java\jdk1.5.0_11\bin can any body can help me to create a classpath for my folder?
[183 byte] By [jesus789a] at [2007-11-27 3:47:34]
# 1

Hi all tht u can do to set classpath is

1) open dos ther type

set classpath=c\doc...\lib;

or

right click on ,y computer go to propertis,

click on Environment variables, click new put name of variable as classpath

value as : c\doc..\lib;

still u have issues let me know

smk_511a at 2007-7-12 8:51:21 > top of Java-index,Java Essentials,New To Java...
# 2
can i change to my folder in dos promt asC:\Documents and Settings\india
jesus789a at 2007-7-12 8:51:21 > top of Java-index,Java Essentials,New To Java...
# 3
cd\Documents and Settings\india
gag.a at 2007-7-12 8:51:21 > top of Java-index,Java Essentials,New To Java...
# 4

With Windows, on the command prompt, you can add to the classpath by saying,

set CLASSPATH=%CLASSPATH%; C:\Documents and Settings\india;

But this will only work for that one window.

To set it for the system, modify Environment Variables under System Properties > Advanced reached by right-clicking My Computer and selecting Properties.

If there isn't already a variable called CLASSPATH, add it. And as it's value, add the path to the directory where your classes will be.

I usually add '.' ( current directory ) as

set CLASSPATH= %CLASSPATH% .;

while i'm testing out my code.

nogoodatcodinga at 2007-7-12 8:51:21 > top of Java-index,Java Essentials,New To Java...
# 5

An alternative - as stated in reply 2 in your other thread on this topic: http://forum.java.sun.com/thread.jspa?threadID=5170470 - is not to set the CLASSPATH environment variable at all. Use the -classpath switch instead.

As the documentation linked to in that reply points out: "The class search path (more commonly known by the shorter name, "class path") can be set using either the -classpath option when calling a JDK tool (the preferred method) or by setting the CLASSPATH environment variable. The -classpath option is preferred because you can set it individually for each application without affecting other applications and without other applications modifying its value."

As always, the documentation is worth reading; the available command line options worth using.

pbrockway2a at 2007-7-12 8:51:21 > top of Java-index,Java Essentials,New To Java...