I am having one problem with my IDE and kotlin. `C...
# server
c
I am having one problem with my IDE and kotlin.
Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
I am using kgraphql in ktor but I am seeing this problem. Not sure how to fix it.
l
Do you need to build with JVM target 1.8? If not, set the javaTarget to 11 in your build.gradle
c
how can I do that? I am using
build.gradle.kts
I know in Android But I don't see any example for Ktor.
l
There’s several ways, but try adding this to the kotlin block
Copy code
jvmToolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
You could also get the ‘compileKotlin’ task by name and set ‘jvmTarget’
c
Thanks @Landry Norris This work. I am still new to all these options.
577 Views