Tomcat as a service modify service parameter values

601 views Asked by At

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

1

There are 1 answers

1
Mark Thomas On BEST ANSWER

You have two options:

  • ++JvmOptions="-D..." adds an additional JVM option
  • --JvmOptions="-D..." removes all existing JVM options and then adds the one you specify.

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.