title: How can I fix "Unresolved reference: java" in Spring Boot Kotlin project?
body: <p>I have created Spring Boot project with</p>
  
  <ul>
  <li>SDK 11. Java Version 11.0.3</li>
  <li>Kotlin as language</li>
  <li>Gradle</li>
  </ul>
  
  <p>I'm following this Tutorial:
  <a href="https://scotch.io/@grahamcox82/how-to-build-a-simple-rest-api-with-kotlin-and-spring-boot" rel="nofollow noreferrer">https://scotch.io/@grahamcox82/how-to-build-a-simple-rest-api-with-kotlin-and-spring-boot</a></p>
  
  <p>I'm trying to </p>
  
  <pre><code>import java.time.Instant
  </code></pre>
  
  <p>in my Kotlin data class</p>
  
  <p>And have an error</p>
  
  <blockquote>
    <p>Unresolved reference: java</p>
  </blockquote>
  
  <p><strong>build.gradle.kts file:</strong></p>
  
  <pre><code>import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  
  plugins {
      id("org.springframework.boot") version "2.1.6.RELEASE"
      id("io.spring.dependency-management") version "1.0.7.RELEASE"
      kotlin("jvm") version "1.2.71"
      kotlin("plugin.spring") version "1.2.71"
  }
  
  group = "com.smight"
  version = "0.0.1"
  java.sourceCompatibility = JavaVersion.VERSION_1_8
  
  val developmentOnly by configurations.creating
  configurations {
      runtimeClasspath {
          extendsFrom(developmentOnly)
      }
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
      implementation("org.springframework.boot:spring-boot-starter-webflux")
      implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
      implementation("org.jetbrains.kotlin:kotlin-reflect")
      implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
      developmentOnly("org.springframework.boot:spring-boot-devtools")
      testImplementation("org.springframework.boot:spring-boot-starter-test")
      testImplementation("io.projectreactor:reactor-test")
  }
  
  tasks.withType&lt;KotlinCompile&gt; {
      kotlinOptions {
          freeCompilerArgs = listOf("-Xjsr305=strict")
          jvmTarget = "1.8"
      }
  }
  
  </code></pre>
  
  <p>Maybe I should install java library? How can I check this?
  Can anyone help please?</p>