v79
06/29/2022, 8:04 PMe: D:\Development\Experiments\Pellet\server\src\main\kotlin\dev\pellet\server\PelletServerClient.kt: (8, 17): Unresolved reference: UnixDomainSocketAddress
IntelliJ can see the import (no red squiggly lines). In Project Structure, I've chosen SDK `openjdk-18 java version "18.0.1"`(and I've also tried the cornetto variant of JDK18). The language level is set to 17 in InteilliJ and in the build.gradle.kts
file. In IntelliJ's External Libraries view I can drill down to <http://java.base.java.net|java.base.java.net>
and see the UnixDomainSocketAddress
class (it was introduced in Java 16).
But neither IntelliJ nor Gradle can find the class to compile it! (I've even dug into the JDK source folder, and it definitely exists!). Please, any ideas?v79
06/29/2022, 8:38 PMkotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of("17"))
}
}
And it worked. So then it dawned on me that JAVA_HOME environment variable might be wrong - and it was pointing to a JDK11 installation. So all that time I've been writing Kotlin code targeting JDK15, I've never once used a class which didn't exist and work in JDK11.v79
06/29/2022, 8:53 PMKlitos Kyriacou
06/30/2022, 9:49 AMv79
06/30/2022, 10:15 AM