JDK_JAVA_OPTIONS
is only picked up by thejava
launcher, so use it for options that you only want to apply (or only make sense for) the java startup command. This variable is also new on JDK 9+, and will be ignored by earlier JDK versions. Hence, it’s useful when migrating from older versions to 9+.JAVA_TOOL_OPTIONS
is picked up also by other java tools likejar
andjavac
so it should be used for flags that you want to apply (and are valid) to all those java tools.