https://kotlinlang.org logo
Title
c

cfleming

03/18/2019, 1:53 AM
I’m having a weird problem where the JVM used by my
compileKotlin
task seems to be different to the one used by Gradle itself. It’s somehow related to the version of the gradle-intellij-plugin I’m using to build an IntelliJ plugin - currently I use 0.3.10 of the plugin and everything in my build script should be set to use Java 8 to compile. However when I upgrade to 0.5.0-SNAPSHOT of the plugin because I need to test my plugin against the new Java 11 JBSDK, I start getting compile errors like:
> Task :compileKotlin FAILED
e: /Users/colin/dev/cursive/src/main/kotlin/cursive/debugger/Fragment.kt: (95, 25): Cannot access class 'com.sun.jdi.StringReference'. Check your module classpath for missing or conflicting dependencies
indicating that my Kotlin code is being compiled with some 9+ JDK.
d

DALDEI

03/21/2019, 8:25 PM
I have gotten similar errors. Sometimes they went away after killing all java processes (like the gradle daemons and kotlin compile daemon) then clearing all the caches I can find -- both in the project directories (out, .gradle) and in $HOME/.gradle And -- deleting all the /tmp/* files One time I tracked it down to a transient dependency of mine that had not been recompiled with the 'current' version
c

cfleming

03/22/2019, 1:53 AM
Thanks for the suggestion, unfortunately it doesn’t seem to have made any difference in my case.