You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by cameron <ca...@ogmios.ca> on 2003/04/26 01:33:57 UTC

classpaths

do classpaths automatically include subdirectories?

i.e. if I put /usr/local/tomcat into my classpath will I be able to find 
the classes defined in: /usr/local/tomcat/common/lib/ or 
/usr/local/tomcat/server/lib/, or do I have to specify each subdir as well?

-Cam



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: classpaths

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
At 04:33 PM 4/25/2003, you wrote:
>do classpaths automatically include subdirectories?
>
>i.e. if I put /usr/local/tomcat into my classpath will I be able to find 
>the classes defined in: /usr/local/tomcat/common/lib/

The smart-ass answer is:
Yes, but only if your classes are defined as part of the common.lib package.

The helpful answer in the general case is:
No, you have to put each directory on your classpath separately.

The helpful answer for Tomcat specifically is:
Provided you're using a fairly recent Tomcat version, you don't have to 
worry about it.  Jars (*not* individual classes) that you put in either 
common/lib or server/lib will be picked up automatically by Tomcat when it 
starts -- that's why those directories are special and revered.  If you're 
not aware of the classloader issues involved with these, be sure to read 
and understand the oft-referenced guide:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

Happy trails,
justin


>  or /usr/local/tomcat/server/lib/, or do I have to specify each subdir as 
> well?
>
>-Cam


____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
    See http://www.nextengine.com/confidentiality.php
____________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: classpaths

Posted by Michael Duffy <du...@yahoo.com>.
No, I don't believe they do.  

Besides, putting a ./lib directory into your classpath
won't do you any good - the jars underneath have to be
listed individually.  If you put a directory into the
classpath, there should only be .class files in it.

--- cameron <ca...@ogmios.ca> wrote:
> do classpaths automatically include subdirectories?
> 
> i.e. if I put /usr/local/tomcat into my classpath
> will I be able to find 
> the classes defined in:
> /usr/local/tomcat/common/lib/ or 
> /usr/local/tomcat/server/lib/, or do I have to
> specify each subdir as well?
> 
> -Cam
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org