See what was done in https://github.com/krzema12/snakeyaml-engine-kmp/pull/255. Using the newest JDK makes use of latest advancements included there. Such SDK can produce bytecode runnavle by other JDKs.