elect
12/12/2023, 5:33 PMelect@5800x:~/IdeaProjects/java-launcher$ echo $JAVA_HOME
/usr/lib/jvm/java-11-openjdk-amd64
Adam S
12/12/2023, 5:40 PMecho blah
instead?elect
12/12/2023, 5:41 PMAdam S
12/12/2023, 5:41 PMelect
12/12/2023, 5:41 PMelect
12/12/2023, 5:42 PM"echo JAVA_HOME" -> JAVA_HOME
elect
12/12/2023, 5:42 PMelect
12/12/2023, 5:44 PMprintenv
isn't empty (list of all envs), but JAVA_HOME
isn't there unfortunately..Adam S
12/12/2023, 5:46 PMAdam S
12/12/2023, 5:46 PMimport org.jetbrains.kotlin.gradle.plugin.mpp.Executable
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
kotlin {
targets.withType<KotlinNativeTarget>().configureEach {
binaries.withType<Executable>().configureEach {
runTaskProvider?.configure {
environment("JAVA_HOME", System.getProperty("java.home"))
}
}
}
}
(not tested, but I've used something similar before)elect
12/12/2023, 5:47 PMnull
elect
12/12/2023, 5:49 PMExecutable
is from org.jetbrain.kotlin.gradle.plugin.mpp
?Adam S
12/12/2023, 5:49 PMAdam S
12/12/2023, 5:49 PMAdam S
12/12/2023, 5:50 PMAdam S
12/12/2023, 5:51 PMSystem.getProperty("java.home")
https://stackoverflow.com/questions/16297326/checking-getting-java-home-variable-from-javaelect
12/12/2023, 5:52 PM/home/elect/.jdks/openjdk-19.0.1
elect
12/12/2023, 5:52 PMelect
12/12/2023, 5:52 PMAdam S
12/12/2023, 5:54 PMelect
12/12/2023, 5:54 PMelect
12/12/2023, 5:55 PMrunDebugExecutableNative
elect
12/12/2023, 10:09 PM./gradlew rDEN
it works flawless, JAVA_HOME
is properly read.. the issue rises up only via Idea gui..Adam S
12/12/2023, 10:18 PMelect
12/13/2023, 8:41 AMAdam S
12/13/2023, 8:43 AMelect
12/13/2023, 8:46 AM