1

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

Piotr P. Karwasz
  • 12,857
  • 3
  • 20
  • 43
WhitneyChia
  • 746
  • 2
  • 11
  • 28

1 Answers1

2

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.

Mark Thomas
  • 16,339
  • 1
  • 39
  • 60