Windows – How to configure TomCat Java options in a config file

configurationtomcatwindows

I'm trying to configure Java options passed into TomCat for a 3rd party application that I'm deploying. The instructions that the app provides are:

  1. Open the Tomcat configuration tool from the Windows menu at Start > All
    Programs > Apache Tomcat > Tomcat Configuration
    .
  2. Click Configure and select the Java tab.
  3. At the bottom of the Java Options field, enter the following:
    -Dexample.license.directory="C:\Program Files\example"
  4. Stop and restart the application server.

However, I need to do this programmatically, so I'd like to know what config file these options can be set in. Using the GUI is impractical for deploying the app to other developers' environments.

(I'm using Tomcat 6.0 if that is relevant…)

Best Answer

If you're using Tomcat as a Windows service, you can adjust the JVM options by going to the bin dir and running:

tomcat6 //US//MYSERVICENAME ++JvmOptions=-Dexample.license.directory="C:\Program Files\example"

Turn the service off before you do this and restart it when you finish.

I just did this for my own tomcat server and it handled it for me.

Related Topic