Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

(I've copied this from Stack Overflow here, after someone suggested I post the question here)

Hi,

I'm trying to setup Tomcat6 to work with JMX on Windows Vista 64.

To do that I need to pass the parameters below to Tomcat6.

What I do in command prompt. (that doesn't work)

set CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9898 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
tomcat6.exe

What I do that does work (but causes other problems)

java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9898 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -jar bootstrap.jar

It seems as if tomcat is just ignoring the environment variable CATALINA_OPTS. Am I doing something wrong?

I've also tried to edit catalina.bat and define the variable CATALINA_OPTS there. No success. (tried adding the parameters to JAVA_OPTS too, no success either)

Thanks in Advance!!

share|improve this question

3 Answers 3

up vote 1 down vote accepted

Silly me, I started tomcat with tomcat6.exe instead of startup.bat.

Now works. Thanks!

share|improve this answer

I had similar when a similar post pointed that I should not use quotes "" when settings CATALINA_OPTS

http://javahowto.blogspot.com/2006/06/6-common-errors-in-setting-java-heap.html

To quote

How to set java heap size in Tomcat? Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin/catalina.sh or catalina.bat for how this variable is used. For example,

set CATALINA_OPTS=-Xms512m -Xmx512m  (Windows, no "" around the value)
export CATALINA_OPTS="-Xms512m -Xmx512m"  (ksh/bash, "" around the value)
setenv CATALINA_OPTS "-Xms512m -Xmx512m"  (tcsh/csh, "" around the value)

In catalina.bat or catallina.sh, you may have noticed CATALINA_OPTS, JAVA_OPTS, or both can be used to specify Tomcat JVM options. What is the difference between CATALINA_OPTS and JAVA_OPTS? The name CATALINA_OPTS is specific for Tomcat servlet container, whereas JAVA_OPTS may be used by other java applications (e.g., JBoss). Since environment variables are shared by all applications, we don't want Tomcat to inadvertently pick up the JVM options intended for other apps. I prefer to use CATALINA_OPTS.

cheers ET

share|improve this answer

If you are running Tomcat as a service, your options are more limited. You may have to open the Tomcat Properties dialog, flip to the Java tab, and add on to the end of the "Java Options" box.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.