I have jvm toolchain configured as follows:
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(GRAAL_VM)
}
}
My Gradle config:
However, if I run
When I run nativeRun
task, I get:
Execution failed for task ':nativeCompile'.
> Determining GraalVM installation failed with message: 'gu' at '/Users/user/.sdkman/candidates/java/current/bin/gu' tool wasn't found. This probably means that JDK at isn't a GraalVM distribution.
the output of java -version
in the project console:
$ java -version
openjdk version "17.0.3" 2022-04-19 LTS
OpenJDK Runtime Environment (build 17.0.3+7-LTS)
OpenJDK 64-Bit Server VM (build 17.0.3+7-LTS, mixed mode, sharing)
an when running nativeCompile task:
> Task :nativeCompile
[native-image-plugin] GraalVM Toolchain detection is disabled
[native-image-plugin] GraalVM location read from environment variable: JAVA_HOME
[native-image-plugin] Native Image executable path: /Users/user/.sdkman/candidates/java/20.0.1-graal/lib/svm/bin/native-image
How should I make the Gradle task honor the JVM toolchain? I do not want to set Graal VM as default in the SDKMAN.
I run nativeRun task from IntelliJ (from Gradle tab).