setenv.sh/setenv.bat are not supplied with Tomcat, but if you add one, Tomcat will use it. It's the best place to put stuff like that, since you totally own that file and don't have to modify any of Tomcat's own files, which can simplify maintenance and assist in intrusion detection (the original Tomcat files would retain their original text/checksum values).
If Tomcat (catalina) detects the presence of a setenv file, it will execute it to set up the environment to be used for the requested catalina operation. This file must have read access rights for the Tomcat user, and I recommend execute rights (where applicable) as well, although I don't think they're actually mandatory.
An IDE is no substitute for an Intelligent Developer.
Joined: Aug 31, 2009
Thanks for your response. I will give this a whirl.
Joined: Aug 31, 2009
Actually I noticed that my tomcat start up script explicitly specifies tomcat6.conf as the configuration file, so I think I should put the JAVA_OPTS setting there. This may be a SuSE Linux convention.
# Get the tomcat config (use this for environment specific settings)
When I set the JAVA_OPTS, do I also have to export it?
SuSe is a lot like Red Hat, and although I usually install Tomcat as a straight UNZIP from tomcat.apache.org, I've also worked on occasion with RPM-based installs. Main reason I don't use RPM for Tomcat routinely is that there's not always an RPM available - especially for up-to-date releases of Tomcat.
What the RPM mostly does is make Tomcat friendlier to the Linux Filesystem Hierarchy Standard, which it does by the magic of softlinks so that Tomcat's logs appear in /var/logs, the temp appears in /var/lib, config appears in /etc, and so forth. Obviously your RPM does just a little bit more than that. I think that tomcat6.conf is actually sourced by an init script which is a third-party addition to the package (take a look at /etc/init.d/tomcat6).
conf files do not require exports. Aside from just being a general Unix/Linux rule, in this particular case, that's because the conf file will be sourced by the init script and then inherited by the catalina script that the init script invokes.