diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79e..7f93135c4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0c85a1f75..ac72c34e8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb4..0adc8e1a5 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. diff --git a/platform/build.gradle.kts b/platform/build.gradle.kts index 0a094609a..d0048155c 100644 --- a/platform/build.gradle.kts +++ b/platform/build.gradle.kts @@ -6,7 +6,7 @@ javaPlatform { allowDependencies() } -val kotlinVersion = "1.8.10" +val kotlinVersion = "1.9.10" val exposedVersion = "0.37.3" val lsp4jVersion = "0.15.0" diff --git a/server/src/main/kotlin/org/javacs/kt/compiler/Compiler.kt b/server/src/main/kotlin/org/javacs/kt/compiler/Compiler.kt index 13c201f50..1cfc25222 100644 --- a/server/src/main/kotlin/org/javacs/kt/compiler/Compiler.kt +++ b/server/src/main/kotlin/org/javacs/kt/compiler/Compiler.kt @@ -119,6 +119,11 @@ private class CompilationEnvironment( // configure jvm runtime classpaths configureJdkClasspathRoots() + // Kotlin 1.8.20 requires us to specify the JDK home, otherwise java.* classes won't resolve + // See https://github.com/JetBrains/kotlin-compiler-server/pull/626 + val jdkHome = File(System.getProperty("java.home")) + put(JVMConfigurationKeys.JDK_HOME, jdkHome) + addJvmClasspathRoots(classPath.map { it.toFile() }) addJavaSourceRoots(javaSourcePath.map { it.toFile() }) diff --git a/server/src/test/resources/additionalWorkspace/gradle.properties b/server/src/test/resources/additionalWorkspace/gradle.properties index 75966ef05..f1ec025b9 100644 --- a/server/src/test/resources/additionalWorkspace/gradle.properties +++ b/server/src/test/resources/additionalWorkspace/gradle.properties @@ -1 +1 @@ -kotlinVersion=1.8.10 +kotlinVersion=1.9.10 diff --git a/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.jar b/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.jar index c1962a79e..7f93135c4 100644 Binary files a/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.jar and b/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.jar differ diff --git a/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.properties b/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.properties index 0c85a1f75..ac72c34e8 100644 --- a/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.properties +++ b/server/src/test/resources/additionalWorkspace/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/server/src/test/resources/additionalWorkspace/gradlew b/server/src/test/resources/additionalWorkspace/gradlew index aeb74cbb4..0adc8e1a5 100755 --- a/server/src/test/resources/additionalWorkspace/gradlew +++ b/server/src/test/resources/additionalWorkspace/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can.