There are several flavors of JVM options that can be set:
1. "plain" options, such as -client, -server, -esa, etc. Some of these are related to one another. For example, if setting -d32, then if there is a -d64 option, it should be replaced.
2. value options without an equals, such as -Xmx512m. If setting -Xmx256m, then -Xmx512m should be replaced.
3. value options with an equals, such as -Da=b or -XX:MaxPermSize=192m. If setting -Da=c, then -Da=b should be replaced.
Since options in flavor 3 are not cumulative, the create-jvm-options command could just automatically provide the replacement behavior without a --replace option. Maybe a warning could be printed to say that replacement is happening. Is there any situation where adding multiple options with the same value before the "=" is desired?
For options in flavors 1 and 2, the create-jvm-options command would need to have knowledge about the options and how they are related, which increases the coupling between the create-jvm-options command and a particular JVM.
For -Xmx and -Xms, the create-jvm-options already has this coupling, but rather than replacing and existing value for one of those options, it adds the additional option and warns that there was already an option for that value (which doesn't seem to be the right behavior).