Does kotlin-kapt 1.6 support java 14?
# kapt
r
Does kotlin-kapt 1.6 support java 14?
t
what do mean by "support Java 14"? 🤔
r
I mean does kotlin kapt work with java 14
t
should
r
I have a multi module project and all the modules are set to java 14, java home is 14 and gradle is also using java 14 but for one module kotlin-kapt complains that
bad class file. File is 58.0 but should be 55.0
So my hunch was somehow kotlin-kapt is picking up java 11 only thats why this complaint
t
without reproducer project hard to tell what is the issue
Does your project use JVM toolchain to set JDK 14?
r
No
t
please try to add toolchain configuration and see your project compiles
r
Ok let me try this
This actually worked
👍 1
Thanks @tapchicoma
Earlier I was using this
Copy code
java {
        sourceCompatibility = JavaVersion.VERSION_14
        targetCompatibility = JavaVersion.VERSION_14
    }

    tasks.compileKotlin {
        kotlinOptions {
            jvmTarget = "14"
        }
    }

    tasks.compileTestKotlin {
        kotlinOptions {
            jvmTarget = "14"
        }
    }
but this did not work
but using the toolchain did work