开发者

Adding to Tomcat Classpath With CATALINA_OPTS

开发者 https://www.devze.com 2023-01-26 20:39 出处:网络
I\'m trying add a directory of jar files (or barring that, each jar file individually) to t开发者_开发知识库he classpath for a tomcat instance.The difficulty is that I can\'t actually modify the /conf

I'm trying add a directory of jar files (or barring that, each jar file individually) to t开发者_开发知识库he 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.


You can place your jar files in

{tomcat.home}/lib

They will be loaded from there.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消