1

We currently run the tomcat 8.5 as windows service. How is it possible to pass over a java property i.e. via -D parameter to the startup of the service?

  • do we can pass over a parameter through the service properties dialogue "startup parameters" of the windows operating system (Service Manager). If yes what would be the syntax?
  • do we need to hard code that property somewhere in the startup bat files of tomcat, if yes which ones?
  • other possibilities i.e. system variable like CATALINA OPTS?

Thank you and regards Mark

megloff
  • 1,400
  • 4
  • 27
  • 44

2 Answers2

3

First sure that you had ran Service.bat install then please run Tomcat7w (or Tomcat8w, Tomcat9w if you use another Tomcat version).

Select Java in Opened windows and add Java Properties in Java Options.

If you install service with another name, example service.bat install TomcatApp then please rename Tomcat7w to **TomcatApp**w before open.

0

This is from the Environment Variable Prerequisites section of the catalina.bat script in Tomcat 8.5:

rem   JAVA_OPTS       (Optional) Java runtime options used when any command
rem                   is executed.
rem                   Include here and not in CATALINA_OPTS all options, that
rem                   should be used by Tomcat and also by the stop process,
rem                   the version command etc.
rem                   Most options should go into CATALINA_OPTS.

You should be able to set the JAVA_OPTS environment variable with your custom -D parameters.

Bill
  • 1,407
  • 10
  • 18