공부 흔적남기기

Intelij gradle '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. error 본문

web study/Spring

Intelij gradle '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. error

65살까지 코딩 2023. 11. 23. 20:54
728x90
반응형

스프링 & 코틀린 프로젝트에서 

gradle build가 자꾸

'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. error가 뜨면서

stuck이 되는 문제가 있었다.

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs = listOf("-Xjsr305=strict")
        jvmTarget = "11"
    }
}

이 적혀있음에도 계속 오류가났다. 

그래서 java 버전이 잘못되었나 확인도 해보았고, gradle에 이것저것도 추가해보고 컴퓨터도 껏다켜보고 intelij setting gralde도 다시 로드해보고 했으나 계속 문제가 반복되었다.

 

해결방법은 .idea를 지우고 다시 로드했더니 해결되었다.. 

망할 intelij 버그였다.

 

 

 

728x90
반응형