Way to programmatically set Java options for Tomcat as a Windows Service
I am looking for a way to programmatically set Java Options for Tomcat 6.0 running as a Windows service. When using startup.bat
and shutdown.bat
, you can set these variables in a setenv.bat
or catalina.bat
file. However, for Tomcat running as a Windows Service, these options must be manually set in the Java Options section of the configuration utility.
Is there any way to programmatically set these options?
Background: I am trying to write an installer that will deploy my app to an existing Tomcat 6.0 server. I can do everything else programmatically, but I'll still have to ask the user to manually add a few Java Options in these settings. This is l开发者_如何学Goess than ideal, especially since these options are case- and whitespace-sensitive.
The Tomcat6 binary for running Tomcat as a Windows service has a bunch of command-line parameters that will likely help you. The only issue I foresee is that it's hard (impossible?) to retrieve the current settings so that you can modify them...
精彩评论