tomcatprocrunapache-commons-daemon

Tomcat as a service modify service parameter values


I currently have tomcat up as a service on a windows server and I want to update a service parameter via cmd. I'm using the below command to do this:

Tomcat9.exe //US//Tomcat9 ++JvmOptions="-DAURA_VERSION=CMD_VERSION"

This works fine, but one thing I noticed is that if that key is there already, it doesn't update the value. Instead it appends another key/value pair. Is there a way to make this update the value if the key is there already otherwise append?

Here I ran my command two times, you can see that it just appends.

enter image description here


Solution

  • You have two options:

    If you have multiple properties set, there is no way to update / replace / remove just one of them. You have to remove them all and then re-add the ones you want.