title: Setting java system properties to a java application
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/372686/how-can-i-specify-system-properties-in-tomcat-configuration-on-startup">How can I specify system properties in Tomcat configuration on startup?</a>  </p>
  </blockquote>
  
  
  
  <p>What i'm trying to do, eventually, is to start TOMCAT with certain java system properties set (in this case jmx setup): </p>
  
  <pre><code>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9898 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false`
  </code></pre>
  
  <p>)</p>
  
  <p>Problem is I don't think i'm doing it right.
  What I'm doing is, in the command prompt window (Working in Vista 64, BTW) I use:</p>
  
  <pre><code>set CATALINA_OPTS=-Dcom.sun.management.jmxremote...
  set JAVA_OPTS=-Dcom.sun.management.jmxremote...
  tomcat6.exe
  </code></pre>
  
  <p>This doesn't seem to work since tomcat6 is not behaving as if the properties were set.
  To test this I used the example Notepad.Jar that comes with the java jdk.
  Tried to run it the same way:</p>
  
  <pre><code>set JAVA_OPTS=-Dcom.sun.management.jmxremote...
  java -jar Notepad.jar
  </code></pre>
  
  <p>which didn't work, but this did work:</p>
  
  <pre><code>java -Dcom.sun.management.jmxremote .... -jar Notepad.jar
  </code></pre>
  
  <p>Since the last attempt did work I concluded that the JAVA/CATALINA_OPTS setup is incorrect.</p>
  
  <p>Could someone point out what i'm doing wrong? I hope I was clear enough.</p>
  
  <p>Thanks!</p>