Hello community, probably silly question incoming:
I’ve set up a project using Kotlin. By default the Kotlin compiler is configured to target JVM 1.6, while the rest of the configuration targets the JVM 1.8. The latter one is desired. This discrepancy causes some problems, e.g. when using
assertThrows<Exception>. The error message I get is: Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper ‘-jvm-target’ option
Setting the proper target JVM in the project settings is possible, but doesn’t seem to be a viable option. I get warned about these settings coming from the Gradle scripts and being overwritten on the next reimport. I suppose I have to specify the desired JVM target somewhere in the Gradle build script, but at this point I’m honestly lost due to insufficient experience with Gradle.
Could someone provide me a hint how to permanently set the Kotlin target JVM? Thanks a lot!