Use a single jvm options file with multiple versions of Java. Simply prefix a line with a specification of which versions it should be included with.
X:
: emitted when target version is exactlyX
X-:
: emitted when target version is at leastX
-Y:
: emitted when target version is not greater thanY
X-Y
: emitted when target version is at leastX
and not greater thanY
8:option that only works with java 8 -11:option that is deprecated after java 11 9- :option that requires at least java 9 11-17:option for use in java 11 through 17 :option that is always included option without prefix that is always included
--
jvm.options
╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 8 < jvm.options option that only works with java 8 option that is deprecated after java 11 option that is always included option without prefix that is always included [success] ╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 9 < jvm.options option that is deprecated after java 11 option that requires at least java 9 option that is always included option without prefix that is always included [success] ╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 10 < jvm.options option that is deprecated after java 11 option that requires at least java 9 option that is always included option without prefix that is always included [success] ╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 11 < jvm.options option that is deprecated after java 11 option that requires at least java 9 option for use in java 11 through 17 option that is always included option without prefix that is always included [success] ╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 12 < jvm.options option that requires at least java 9 option for use in java 11 through 17 option that is always included option without prefix that is always included [success] ╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 17 < jvm.options option that requires at least java 9 option for use in java 11 through 17 option that is always included option without prefix that is always included [success] ╭─{ rye@perhaps:~/src/REDACTED } ╰─● ./filter_jvm_ops 18 < jvm.options option that requires at least java 9 option that is always included option without prefix that is always included [success]