diff --git a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt index 797a4918a77..ee543304603 100644 --- a/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt +++ b/compiler/daemon/daemon-client/src/org/jetbrains/kotlin/daemon/client/KotlinCompilerClient.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.daemon.client import net.rubygrapefruit.platform.Native +import net.rubygrapefruit.platform.NativeException import net.rubygrapefruit.platform.ProcessLauncher import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity @@ -386,8 +387,15 @@ object KotlinCompilerClient { val processBuilder = ProcessBuilder(args) processBuilder.redirectErrorStream(true) // assuming daemon process is deaf and (mostly) silent, so do not handle streams - val daemonLauncher = Native.get(ProcessLauncher::class.java) - val daemon = daemonLauncher.start(processBuilder) + val daemon = + try { + val nativeLauncher = Native.get(ProcessLauncher::class.java) + nativeLauncher.start(processBuilder) + } + catch (e: NativeException) { + reportingTargets.report(DaemonReportCategory.DEBUG, "Could not start daemon with native process launcher, falling back to ProcessBuilder#start") + processBuilder.start() + } val isEchoRead = Semaphore(1) isEchoRead.acquire()