Open jacobsandlund opened 2 years ago
For me, I got it working with setting:
# in gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
# in gradle.properties
javaVersion=17
Though there were some intermediate failures:
Compilation with Kotlin compile daemon was not successful
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.util.io.FileChannelUtil
...
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.util.io.FileChannelUtil
...
Could not connect to kotlin daemon. Using fallback strategy.
Could you check whether this still occurs on the most recent language server?
same thing happened to me.
I had to make the following changes to match the JVM available to gradle
diff --git a/gradle.properties b/gradle.properties
index e8355f8..0cdae21 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,4 +2,4 @@ projectVersion=1.4.0
kotlinVersion=1.6.10
exposedVersion=0.37.3
lsp4jVersion=0.12.0
-javaVersion=11
+javaVersion=15
diff --git a/server/build.gradle b/server/build.gradle
index 08d5c29..82fc80e 100644
--- a/server/build.gradle
+++ b/server/build.gradle
@@ -72,7 +72,7 @@ applicationDistribution.into('bin') {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
- jvmTarget = "11"
+ jvmTarget = "15"
}
}
Upgrade to the latest Gradle & kotlin plugin, it ought to work.
I tried building using
./gradlew :server:installDist
with java version17.0.2
on the PATH. I get this failure:From some Googling, I found this issue in a different project, and what may have helped them is updating to Gradle 7.4 and some other changes (see this comment).