title: Make a Bazel Kotlin target use a local JDK
body: <p>I've downloaded the source code for OpenJDK 17, edited <a href="https://github.com/AdoptOpenJDK/openjdk-jdk14/blob/5ed4b9f2c0a1572da09fef84aaf0ce899689c4c2/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11KeyStore.java" rel="nofollow noreferrer">P11KeyStore.java</a> as a workaround for a problem I'm facing, and compiled the modified JDK. Now I need to build a Kotlin target using Bazel, and I need it to pick up the change to P11KeyStore.java. I'm not sure whether that means using the custom JDK at compile time or at runtime, but in any case I need to make &quot;bazel build&quot; and/or &quot;bazel run&quot; use it.</p>
  <p>Does anyone know of a way to do this with Bazel 5.0.0? I've already tried setting JAVA_HOME and passing  <code>--extra_toolchains=@local_jdk//:all</code> to Bazel, which is supposed to do what I want but for a Java target. It seemed to have no effect on my build.</p>