1

In one of my project, I got a requirement to display JVM parameters which are setup while creating tomcat as a service. I'm referring https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html but I didn't find any solution of my requirement. Please suggest me solution. Thanks in advance!

Tushar Paliwal
  • 301
  • 4
  • 11

2 Answers2

2

You are looking for the Tomcat Monitor application, which is one of the first sections on the page you referenced.

From the command-line, you can run this set of commands:

C:\> \path\to\tomcat\bin\tomcat7w.exe //ES//

If you have used a customized name for your service, you can do this:

C:\> \path\to\tomcat\bin\tomcat7w.exe //ES//custom-name
Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
  • Thanks for the solution, this is valuable for me. But i wanna use these parameters to my application and command opens a window. Actually I'm using java to consume this. – Tushar Paliwal Jul 14 '16 at 13:15
  • @TusharPaliwal So, you want a Java application to be able to read those parameters from the service definition? All of the parameters and configuration are stored in the registry, so you just have to go mine those values from the right place. Use `regedit` to find the keys you want and then see [this SO question](http://stackoverflow.com/questions/62289/read-write-to-windows-registry-using-java). – Christopher Schultz Jul 14 '16 at 13:34
  • I checked registry keys but it doesn't contain parameters which I used while creating tomcat service. for instance -> Java options. – Tushar Paliwal Jul 15 '16 at 07:37
  • 1
    @TusharPaliwal Hmm... those values should be in the registry. Have a look at http://commons.apache.org/proper/commons-daemon/procrun.html#Windows_Registry_Usage which details where items are stored in the Windows Registry. – Christopher Schultz Jul 15 '16 at 14:04
1

You can try to get command line options on PowerShell.

Get-WmiObject Win32_Process -Filter "Caption='tomcat.exe'" | Format-List CommandLine
sozkul
  • 665
  • 4
  • 10