0
votes

I'm trying add a directory of jar files (or barring that, each jar file individually) to the classpath for a tomcat instance. The difficulty is that I can't actually modify the /conf/catalina.properties file for this particular problem. I can set the CATALINA_OPTS variable, ie:

export CATALINA_OPTS = "$CATALINA_OPTS -classpath /path/to/lib/file.jar"

However, this does not seem to add the jar file to the classpath.

Is it even possible to modify the Tomcat classpath like this? I'm aware that the CLASSPATH variable isn't used at all.

3

3 Answers

3
votes

You can place your jar files in

{tomcat.home}/lib

They will be loaded from there.

1
votes

Take a look on script that runs your tomcat. Print classpath just before it runs java process. As far as I remember it is using variable CLASSPATH when composing the command line.

1
votes

Tomcat has an extension folder, designed to contain these kinds of jars. If I recall correctly it is just a matter of copying your jars to this folder.