https://kotlinlang.org logo
Title
p

Paul Woitaschek

11/18/2020, 10:36 AM
Not 100% related but it seems compose desktop needs java 11. I thought I could just specify that in gradle:
java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}
But when running from the command line:
./gradlew run
It shows an error:
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: org/jetbrains/skiko/Library 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
e

eskatos

11/18/2020, 10:38 AM
I suppose the Kotlin Gradle plugin must be changed to take Gradle Java Toolchains into account before this can work out of the box https://youtrack.jetbrains.com/issue/KT-43095
b

Big Chungus

11/18/2020, 10:39 AM
Also note that you need Java 14+ to build native executables
o

olonho

11/18/2020, 10:54 AM
guess setting JAVA_HOME shall help
p

Paul Woitaschek

11/18/2020, 10:54 AM
Yeah for me too. But I love how the project is self contained and reproducible when you just set the jdk version in gradle.
s

spierce7

11/18/2020, 2:51 PM
to package it, you need Java 15