https://kotlinlang.org logo
Title
a

arekolek

01/23/2021, 11:54 AM
How do you run your apps when developing? From command line or Gradle tool window in IDE? I’m having an issue with the latter that it uses a wrong JDK to run it, ending up in error:
MainKt has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
./gradlew run
from command line works fine Where do I configure JDK for the IDE? (IntelliJ IDEA CE 2020.3.1)
c

christophsturm

01/23/2021, 11:59 AM
File/Project Structure
a

arekolek

01/23/2021, 12:24 PM
I see the correct one there (the error is with
jdk1.8.0_192.jdk
)
d

dector

01/23/2021, 12:27 PM
That's right. You need JDK11+
a

arekolek

01/23/2021, 12:35 PM
Yeah, but I don’t see that jdk set anywhere, when I do
java -version
in terminal I get
openjdk version "15.0.2" 2021-01-19
I’m comparing with this sample https://github.com/JetBrains/compose-jb/tree/master/examples/imageviewer (which runs from IDE) and the only difference I see is project language level (they set 15), but it doesn’t fix it for me
I created my project using the built-in wizard and that was it
c

christophsturm

01/23/2021, 12:51 PM
there is a separate setting for gradle vm. in preferences
a

arekolek

01/23/2021, 1:13 PM
That was it, thanks 👍