3

I'm running tomcat6, and I'm unclear if I need to set java_opts or CATALINA_OPTS?

Also, in catalina.sh there is allot of references to CATALINA_OPTS, so I'm not sure either where I should be modifying the heap size?

Blankman
  • 259,732
  • 324
  • 769
  • 1,199

2 Answers2

5

You can set JAVA_OPTS or CATALINA_OPTS at the top of the catalina.sh file. All the places a new value is set they ensure that it is appending to the existing values.

I prefer setting it in startup.sh instead of catalina.sh. Setting it in catalina.sh would apply to the process started by shutdown command as well.

gkamal
  • 20,777
  • 4
  • 60
  • 57
  • Those script will run `setenv.sh`(or `setenv.bat` on windows), it's usually better to create/edit those files and add the env. variables there, so you can keep your settings apart from the shipped scripts. – nos Dec 21 '11 at 10:26
  • but what if it appends a setting that already exists? like Xmx? – codecompleting Dec 21 '11 at 15:19
3

The proper way to add custom things to Tomcat is by creating <tomcat_home>/bin/setenv.sh (on Unix) or <tomcat_home>/bin/setenv.bat (on Windows).

See this question as an example.

Community
  • 1
  • 1
mindas
  • 26,463
  • 15
  • 97
  • 154