CLASSPATH help using classes and jar files.  
Author Message
snoopy_@excite.com





PostPosted: 2007-1-17 2:33:00 Top

java-programmer, CLASSPATH help using classes and jar files. I am new to java, what is the correct way to define CLASSPATH for the
files like test.class or test.jar. In unix if I want to provide a
PATH to an executable like /userfiles/test.exe I would do the
following:

PATH=/userfiles

This provides a directory to search for.

In JAVA, I thought it was the same, but in some instances on our system
I see it point to the exact class file. For example:

CLASSPATH=/userfiles/test.class

Shouldn't it be CLASSPATH=/userfiles ?

The same for JAR files. Should it be CLASSPATH=/userfiles, or
CLASSPATH=/userfiles/test.jar



Thanks.

 
RedGrittyBrick





PostPosted: 2007-1-17 3:08:00 Top

java-programmer >> CLASSPATH help using classes and jar files. email***@***.com wrote:
> I am new to java, what is the correct way to define CLASSPATH for the
> files like test.class or test.jar. In unix if I want to provide a
> PATH to an executable like /userfiles/test.exe I would do the
> following:
>
> PATH=/userfiles
>
> This provides a directory to search for.
>
> In JAVA, I thought it was the same, but in some instances on our system
> I see it point to the exact class file. For example:
>
> CLASSPATH=/userfiles/test.class
>
> Shouldn't it be CLASSPATH=/userfiles ?
>
> The same for JAR files. Should it be CLASSPATH=/userfiles, or
> CLASSPATH=/userfiles/test.jar
>

See http://mindprod.com/jgloss/classpath.html