> when setting the environment variable, one of the steps is to set the
> classpath. Some books use this: classpath=c:\jdk\lib\tools.jar; c:
> \jdk\lib\dt.jar; Anothers use this: c:\jdk\lib . Q: Any
> different?
Neither one works. The environment variable is 'CLASSPATH', not 'classpath',
and you don't put spaces in it.
Even after correcting those errors, the second form will not pick up the JAR
files, nor is the first form isn't necessary because the JARs in the
$JAVA_HOME/lib/ directory don't need to be part of the classpath explicitly.
In any event, all your questions should be answered by the information in the
documentation:
<http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html>
I strongly recommend that you do not use the CLASSPATH envar, but use the
-classpath (or -cp) option to your Java tools. CLASSPATH is far too global.
Also, read
<http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html>

Signature
Lew
Arne Vajhøj - 28 Feb 2008 01:20 GMT
>> Some books use this: classpath=c:\jdk\lib\tools.jar;
> nor is the first form isn't necessary because the JARs in the
> $JAVA_HOME/lib/ directory don't need to be part of the classpath
> explicitly.
I don't think tools.jar is in classpath by default.
> I strongly recommend that you do not use the CLASSPATH envar, but use
> the -classpath (or -cp) option to your Java tools. CLASSPATH is far too
> global.
Very good advice.
Arne
525 - 28 Feb 2008 05:11 GMT
> > when setting the environment variable, one of the steps is to set the
> > classpath. Some books use this: classpath=c:\jdk\lib\tools.jar; c:
[quoted text clipped - 20 lines]
> --
> Lew
Thanks!! Another question is: Can we ignore the CLASSPATH set if we
use the IDE (like the NetBeans) to program?
> when setting the environment variable, one of the steps is to set the
> classpath. Some books use this: classpath=c:\jdk\lib\tools.jar; c:
> \jdk\lib\dt.jar; Anothers use this: c:\jdk\lib . Q: Any
> different?
My classpath is:
CLASSPATH='.;C:\Program Files\Java\jre1.6.0_03\lib\ext\QTJava.zip'
c:\jdk in your path may refer to the path to the actual JDK. On Windows
it should be closer to something like mine.
Hey I just realized that lib\ext should be included by default, right?
So why the heck did QTJava want to add itself to the classpath in that
manner?
On Wed, 27 Feb 2008 16:38:41 -0800 (PST), 525
<xuemingzhang525@gmail.com> wrote, quoted or indirectly quoted someone
who said :
>when setting the environment variable, one of the steps is to set the
>classpath. Some books use this: classpath=c:\jdk\lib\tools.jar; c:
>\jdk\lib\dt.jar; Anothers use this: c:\jdk\lib . Q: Any
>different?
Classpath is broken. It won't looks for jars given just the dir
names.
See http://mindprod.com/jgloss/classpath.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com