From d9b0e4db48bda970a3ba05813d9cb62a646123fb Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Tue, 13 Oct 2015 18:02:48 +0200 Subject: [PATCH] Simplifying java binary selection: java.awt.headless property seems work on all platforms --- .../jetbrains/kotlin/rmi/kotlinr/KotlinCompilerClient.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/rmi/kotlinr/src/org/jetbrains/kotlin/rmi/kotlinr/KotlinCompilerClient.kt b/compiler/rmi/kotlinr/src/org/jetbrains/kotlin/rmi/kotlinr/KotlinCompilerClient.kt index d979febe194..64f4ccf277f 100644 --- a/compiler/rmi/kotlinr/src/org/jetbrains/kotlin/rmi/kotlinr/KotlinCompilerClient.kt +++ b/compiler/rmi/kotlinr/src/org/jetbrains/kotlin/rmi/kotlinr/KotlinCompilerClient.kt @@ -298,13 +298,8 @@ public object KotlinCompilerClient { private fun startDaemon(compilerId: CompilerId, daemonJVMOptions: DaemonJVMOptions, daemonOptions: DaemonOptions, reportingTargets: DaemonReportingTargets) { - val javaExecutable = File(System.getProperty("java.home"), "bin").let { - val javaw = File(it, "javaw.exe") - // TODO: doesn't seem reliable enough, consider more checks if OS is of windows flavor, etc. - if (javaw.exists() && javaw.isFile && javaw.canExecute()) javaw else File(it, "java") - } - // TODO add os detection to specify option more precisely - val platformSpecificOptions = listOf("-Djava.awt.headless=true") // hide daemon in OS X + val javaExecutable = File(File(System.getProperty("java.home"), "bin"), "java") + val platformSpecificOptions = listOf("-Djava.awt.headless=true") // hide daemon window val args = listOf( javaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) + platformSpecificOptions +