title: How to set compileJava' task ( 11) and 'compileKotlin' task (1.8) jvm target compatibility to the same Java version in build.gradle.kts?
body: <p>Build.gradle.kts</p>
  <pre><code>buildscript {
      repositories {
          google()
          mavenCentral()
          gradlePluginPortal()
      }
      dependencies {
          classpath (&quot;com.android.tools.build:gradle:7.0.2&quot;)
          classpath (&quot;org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30&quot;)
          classpath(&quot;gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:${Versions.spotbugsGradlePluginVersion}&quot;)
          classpath(&quot;se.bjurr.violations:violations-gradle-plugin:${Versions.violationsVersion}&quot;)
  
      }
  }
  //android {
  //    compileOptions {
  //        sourceCompatibility = JavaVersion.VERSION_11
  //                targetCompatibility = JavaVersion.VERSION_11
  //    }
  //
  //    kotlinOptions {
  //        jvmTarget = JavaVersion.VERSION_11.toString()
  //    }
  //}
  plugins {
      `maven-publish`
      `java-gradle-plugin`
      `kotlin-dsl`
      id (&quot;io.gitlab.arturbosch.detekt&quot;) version (&quot;1.18.1&quot;)
  }
  repositories {
      google()
      mavenCentral()
      gradlePluginPortal()
  }
  
  dependencies {
      compileOnly(gradleApi())
      testImplementation(gradleTestKit())
      testImplementation(&quot;junit:junit:${Versions.jUnitVersion}&quot;)
  }
  val generatedSources = tasks.register&lt;GenerateVersionsFileTask&gt;(&quot;generateSources&quot;)
  </code></pre>
  <p>ERROR :
  'compileJava' task (current target is 11) and 'compileKotlin' task (current target is 1.8) jvm target compatibility should be set to the same Java version.</p>
  <p>When I uncomment android {}
  Error :
  Script compilation errors:</p>
  <pre><code> Line 15: android {
             ^ Unresolved reference: android
  </code></pre>
  <p>Thanks for your time and effort :)
  Jitendra</p>