views:

177

answers:

1

I use Tomcat 6.0.20 and JDK 1.6.0.13.

How can I load libraries from sub-folders of "%TOMCAT_HOME%/lib/" without taking the .jars out of sub-folders and putting them straight into "%TOMCAT_HOME%/lib/"?

The reason I want to do this, is because many apps are going to be sharing lots of libraries.

So, for the sakes of organization I want to store them into folders as such:
%TOMCAT_HOME%/lib/novell/*.jar
%TOMCAT_HOME%/lib/mail/*.jar
%TOMCAT_HOME%/lib/upload/*.jar
etc.

How would I go about this? And please provide an example. Do I use setclasspath.bat, catalina.properties or something completely different? Thanks in advance.

A: 

Define those paths in shared.loader property of /conf/catalina.properties file.

E.g.

shared.loader = ${catalina.home}/lib/novell/*.jar, ${catalina.home}/lib/mail/*.jar, ${catalina.home}/lib/upload/*.jar

[Edit] optionally you can also use the common.loader property for this. See what has your preference.

BalusC