Gradle: Couldn't connect to Kotlin daemon on Windows

Multi tool use
Multi tool use












0















When I try a task that involves a compileKotlin (or compileTestKotlin), then I receive this warning and the result is unpleasant long duration of the build process:




Could not perform incremental compilation: Could not connect to Kotlin compile daemon



Could not connect to kotlin daemon. Using fallback strategy.






I'm not sure the issue is related to my OS (Windows) or not, but I have the same project (with synchronized files) on a remote machine with Linux OS and the issue doesn't exist there. See below comparison:





  1. The project on my remote machine (Linux) with a little change in Kotlin sources (in one module):



    $ ./gradlew build

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD SUCCESSFUL in 5s
    46 actionable tasks: 17 executed, 29 up-to-date



  2. Same project on my local machine (Windows) with same change:



    > gradlew build                                                                                       

    > Task :backend:compileKotlin
    Could not perform incremental compilation: Could not connect to Kotlin compile daemon
    Could not connect to kotlin daemon. Using fallback strategy.

    warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified

    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

    BUILD SUCCESSFUL in 14s
    46 actionable tasks: 17 executed, 29 up-to-date



Especially see build duration time in above two samples (and the warning after compileKotlin task on Windows machine). Even though my local machine (Windows) has more powerful hardware, but the result is the opposite (Gradle daemon is running on both).





In order to further analyzability I also publish the output of gradle -v and java -version on both machines:





  1. Linux:



    $ ./gradlew -v

    ------------------------------------------------------------
    Gradle 5.0
    ------------------------------------------------------------

    Build time: 2018-11-26 11:48:43 UTC
    Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

    Kotlin DSL: 1.0.4
    Kotlin: 1.3.10
    Groovy: 2.5.4
    Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
    JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
    OS: Linux 3.10.0-862.11.6.el7.x86_64 amd64


    $ java -version
    openjdk version "1.8.0_191"
    OpenJDK Runtime Environment (build 1.8.0_191-b12)
    OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)



  2. Windows:



    > gradlew -v                                                           

    ------------------------------------------------------------
    Gradle 5.0
    ------------------------------------------------------------

    Build time: 2018-11-26 11:48:43 UTC
    Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

    Kotlin DSL: 1.0.4
    Kotlin: 1.3.10
    Groovy: 2.5.4
    Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
    JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
    OS: Windows 10 10.0 amd64


    > java -version
    openjdk version "11.0.1" 2018-10-16
    OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
    OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)





Global gradle.properties files on two machines are exactly same (and there is no poject-local gradle.properties file for none):



org.gradle.daemon=true
org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true


(without comments)





UPDATE 1:



There is no problem when Gradle JVM has been set to JDK 8. But with JDK 9+ you can see the issue.





UPDATE 2:



I updated my Kotlin plugin from 1.3.10 to 1.3.11. Also, tested 1.3.20-eap-52. But the issue persists.





UPDATE 3:



I ran Gradle's compileKotlin task with --debug option to get more information. The most important parts of the output are:



Note: Below tasks have been run when Gradle daemon was running, Kotlin compile daemon was stopped (if already running) and a little change has been made in a Kotlin source.



I. When using JDK 8 as Gradle's JVM (OK):



11:01:44 PM: Executing task 'compileKotlin --debug'...
...
22:58:20.512 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps3085207010700515672GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
...
22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (270393 ms old), trying to connect
22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (270393 ms old), but no daemon, ignoring it
22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (63606 ms old), trying to connect
22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (63606 ms old), but no daemon, ignoring it
22:58:33.515 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk1.8.0_202jrebinjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar
22:58:33.515 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
22:58:33.516 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (277256 ms old), trying to connect
22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (277256 ms old), but no daemon, ignoring it
22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (70469 ms old), trying to connect
22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (70469 ms old), but no daemon, ignoring it
22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17507 (70 ms old), trying to connect
22:58:33.516 [INFO] [org.gradle.api.Task] i: connected to the daemon
22:58:33.518 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=true, modifiedFiles=[D:DevelIdeaProjectsGradleKotlinJVMsrcmainkotlinMain.kt], deletedFiles=, workingDir=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlinbuild-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain])
22:58:33.524 [DEBUG] [sun.rmi.transport.tcp] Daemon worker: reuse connection
...
22:58:35.428 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=C:UsersIAppDataLocalTempkjps6683894818132820708GradleKotlinJVM.script.xml, -classpath, D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
...
11:01:53 PM: Task execution finished 'compileKotlin --debug'.


II. When using JDK 11 as Gradle's JVM (Problem here):



11:01:44 PM: Executing task 'compileKotlin --debug'...
...
23:01:45.888 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps11452575260818015211GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
...
23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
23:01:48.137 [WARN] [org.gradle.api.Project] Could not perform incremental compilation: Could not connect to Kotlin compile daemon
23:01:48.137 [WARN] [org.gradle.api.Project] Could not connect to kotlin daemon. Using fallback strategy.
23:01:49.486 [LIFECYCLE] [system.err]
23:01:49.486 [ERROR] [system.err] logging: using Kotlin home directory <no_path>
23:01:49.521 [ERROR] [system.err] logging: configuring the compilation environment
23:01:50.538 [ERROR] [system.err] logging: loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]
23:01:53.459 [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified
...
11:01:53 PM: Task execution finished 'compileKotlin --debug'.


III. When using JDK 11 as Gradle's JVM, but on Linux (OK):



$ ./gradlew compileKotlin --debug
...
01:33:20.145 [INFO] [org.gradle.api.Task] i: starting the daemon as: /usr/local/jdk-11.0.1/bin/java -cp /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath /usr/share/nginx/html/0xy/.kotlin/daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar
01:33:20.145 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
01:33:20.145 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
01:33:20.145 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
01:33:20.145 [INFO] [org.gradle.api.Task] i: found daemon on port 17613 (56 ms old), trying to connect
01:33:20.145 [INFO] [org.gradle.api.Task] i: connected to the daemon
01:33:20.145 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin/build-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[/usr/share/nginx/html/0xy/test/build/classes/kotlin/main])
...
01:33:21.920 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=/tmp/kjps15100965302804914597GradleKotlinJVM.script.xml, -classpath, /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.10/71d0fa967493eb76648b575edf1762cb2d0c7f10/kotlin-stdlib-jdk8-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.10/4d147bf43060dc43d61b096e24da1e67dfe0c032/kotlin-stdlib-jdk7-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-compiler-embeddable/1.3.10/e96a6125793c4ab0258119fcdce9d182f42d32b0/kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
...


There are some suspected events in the above logs (second), but I can't exactly understand the meaning of them and that they are related to my problem or not:




  1. Why two (exactly equal) tries has occurred to start Kotlin compile daemon?

  2. There are some errors. But they are all after warnings about Kotlin's daemon problem.


  3. The latest error/warning:



    [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified


    is the most suspected thing! Because it's the only message you can't find in other logs. Also see here. I asked about it in another post.












share|improve this question





























    0















    When I try a task that involves a compileKotlin (or compileTestKotlin), then I receive this warning and the result is unpleasant long duration of the build process:




    Could not perform incremental compilation: Could not connect to Kotlin compile daemon



    Could not connect to kotlin daemon. Using fallback strategy.






    I'm not sure the issue is related to my OS (Windows) or not, but I have the same project (with synchronized files) on a remote machine with Linux OS and the issue doesn't exist there. See below comparison:





    1. The project on my remote machine (Linux) with a little change in Kotlin sources (in one module):



      $ ./gradlew build

      Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
      Use '--warning-mode all' to show the individual deprecation warnings.
      See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

      BUILD SUCCESSFUL in 5s
      46 actionable tasks: 17 executed, 29 up-to-date



    2. Same project on my local machine (Windows) with same change:



      > gradlew build                                                                                       

      > Task :backend:compileKotlin
      Could not perform incremental compilation: Could not connect to Kotlin compile daemon
      Could not connect to kotlin daemon. Using fallback strategy.

      warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified

      Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
      Use '--warning-mode all' to show the individual deprecation warnings.
      See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

      BUILD SUCCESSFUL in 14s
      46 actionable tasks: 17 executed, 29 up-to-date



    Especially see build duration time in above two samples (and the warning after compileKotlin task on Windows machine). Even though my local machine (Windows) has more powerful hardware, but the result is the opposite (Gradle daemon is running on both).





    In order to further analyzability I also publish the output of gradle -v and java -version on both machines:





    1. Linux:



      $ ./gradlew -v

      ------------------------------------------------------------
      Gradle 5.0
      ------------------------------------------------------------

      Build time: 2018-11-26 11:48:43 UTC
      Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

      Kotlin DSL: 1.0.4
      Kotlin: 1.3.10
      Groovy: 2.5.4
      Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
      JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
      OS: Linux 3.10.0-862.11.6.el7.x86_64 amd64


      $ java -version
      openjdk version "1.8.0_191"
      OpenJDK Runtime Environment (build 1.8.0_191-b12)
      OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)



    2. Windows:



      > gradlew -v                                                           

      ------------------------------------------------------------
      Gradle 5.0
      ------------------------------------------------------------

      Build time: 2018-11-26 11:48:43 UTC
      Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

      Kotlin DSL: 1.0.4
      Kotlin: 1.3.10
      Groovy: 2.5.4
      Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
      JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
      OS: Windows 10 10.0 amd64


      > java -version
      openjdk version "11.0.1" 2018-10-16
      OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
      OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)





    Global gradle.properties files on two machines are exactly same (and there is no poject-local gradle.properties file for none):



    org.gradle.daemon=true
    org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    org.gradle.parallel=true


    (without comments)





    UPDATE 1:



    There is no problem when Gradle JVM has been set to JDK 8. But with JDK 9+ you can see the issue.





    UPDATE 2:



    I updated my Kotlin plugin from 1.3.10 to 1.3.11. Also, tested 1.3.20-eap-52. But the issue persists.





    UPDATE 3:



    I ran Gradle's compileKotlin task with --debug option to get more information. The most important parts of the output are:



    Note: Below tasks have been run when Gradle daemon was running, Kotlin compile daemon was stopped (if already running) and a little change has been made in a Kotlin source.



    I. When using JDK 8 as Gradle's JVM (OK):



    11:01:44 PM: Executing task 'compileKotlin --debug'...
    ...
    22:58:20.512 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps3085207010700515672GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
    ...
    22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (270393 ms old), trying to connect
    22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
    22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (270393 ms old), but no daemon, ignoring it
    22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (63606 ms old), trying to connect
    22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
    22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (63606 ms old), but no daemon, ignoring it
    22:58:33.515 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk1.8.0_202jrebinjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar
    22:58:33.515 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
    22:58:33.516 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
    22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (277256 ms old), trying to connect
    22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
    22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (277256 ms old), but no daemon, ignoring it
    22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (70469 ms old), trying to connect
    22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
    22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (70469 ms old), but no daemon, ignoring it
    22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17507 (70 ms old), trying to connect
    22:58:33.516 [INFO] [org.gradle.api.Task] i: connected to the daemon
    22:58:33.518 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=true, modifiedFiles=[D:DevelIdeaProjectsGradleKotlinJVMsrcmainkotlinMain.kt], deletedFiles=, workingDir=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlinbuild-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain])
    22:58:33.524 [DEBUG] [sun.rmi.transport.tcp] Daemon worker: reuse connection
    ...
    22:58:35.428 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=C:UsersIAppDataLocalTempkjps6683894818132820708GradleKotlinJVM.script.xml, -classpath, D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
    ...
    11:01:53 PM: Task execution finished 'compileKotlin --debug'.


    II. When using JDK 11 as Gradle's JVM (Problem here):



    11:01:44 PM: Executing task 'compileKotlin --debug'...
    ...
    23:01:45.888 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps11452575260818015211GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
    ...
    23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
    23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
    23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
    23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
    23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
    23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
    23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
    23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
    23:01:48.137 [WARN] [org.gradle.api.Project] Could not perform incremental compilation: Could not connect to Kotlin compile daemon
    23:01:48.137 [WARN] [org.gradle.api.Project] Could not connect to kotlin daemon. Using fallback strategy.
    23:01:49.486 [LIFECYCLE] [system.err]
    23:01:49.486 [ERROR] [system.err] logging: using Kotlin home directory <no_path>
    23:01:49.521 [ERROR] [system.err] logging: configuring the compilation environment
    23:01:50.538 [ERROR] [system.err] logging: loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]
    23:01:53.459 [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified
    ...
    11:01:53 PM: Task execution finished 'compileKotlin --debug'.


    III. When using JDK 11 as Gradle's JVM, but on Linux (OK):



    $ ./gradlew compileKotlin --debug
    ...
    01:33:20.145 [INFO] [org.gradle.api.Task] i: starting the daemon as: /usr/local/jdk-11.0.1/bin/java -cp /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath /usr/share/nginx/html/0xy/.kotlin/daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar
    01:33:20.145 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
    01:33:20.145 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
    01:33:20.145 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
    01:33:20.145 [INFO] [org.gradle.api.Task] i: found daemon on port 17613 (56 ms old), trying to connect
    01:33:20.145 [INFO] [org.gradle.api.Task] i: connected to the daemon
    01:33:20.145 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin/build-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[/usr/share/nginx/html/0xy/test/build/classes/kotlin/main])
    ...
    01:33:21.920 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=/tmp/kjps15100965302804914597GradleKotlinJVM.script.xml, -classpath, /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.10/71d0fa967493eb76648b575edf1762cb2d0c7f10/kotlin-stdlib-jdk8-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.10/4d147bf43060dc43d61b096e24da1e67dfe0c032/kotlin-stdlib-jdk7-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-compiler-embeddable/1.3.10/e96a6125793c4ab0258119fcdce9d182f42d32b0/kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
    ...


    There are some suspected events in the above logs (second), but I can't exactly understand the meaning of them and that they are related to my problem or not:




    1. Why two (exactly equal) tries has occurred to start Kotlin compile daemon?

    2. There are some errors. But they are all after warnings about Kotlin's daemon problem.


    3. The latest error/warning:



      [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified


      is the most suspected thing! Because it's the only message you can't find in other logs. Also see here. I asked about it in another post.












    share|improve this question



























      0












      0








      0


      1






      When I try a task that involves a compileKotlin (or compileTestKotlin), then I receive this warning and the result is unpleasant long duration of the build process:




      Could not perform incremental compilation: Could not connect to Kotlin compile daemon



      Could not connect to kotlin daemon. Using fallback strategy.






      I'm not sure the issue is related to my OS (Windows) or not, but I have the same project (with synchronized files) on a remote machine with Linux OS and the issue doesn't exist there. See below comparison:





      1. The project on my remote machine (Linux) with a little change in Kotlin sources (in one module):



        $ ./gradlew build

        Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
        Use '--warning-mode all' to show the individual deprecation warnings.
        See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

        BUILD SUCCESSFUL in 5s
        46 actionable tasks: 17 executed, 29 up-to-date



      2. Same project on my local machine (Windows) with same change:



        > gradlew build                                                                                       

        > Task :backend:compileKotlin
        Could not perform incremental compilation: Could not connect to Kotlin compile daemon
        Could not connect to kotlin daemon. Using fallback strategy.

        warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified

        Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
        Use '--warning-mode all' to show the individual deprecation warnings.
        See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

        BUILD SUCCESSFUL in 14s
        46 actionable tasks: 17 executed, 29 up-to-date



      Especially see build duration time in above two samples (and the warning after compileKotlin task on Windows machine). Even though my local machine (Windows) has more powerful hardware, but the result is the opposite (Gradle daemon is running on both).





      In order to further analyzability I also publish the output of gradle -v and java -version on both machines:





      1. Linux:



        $ ./gradlew -v

        ------------------------------------------------------------
        Gradle 5.0
        ------------------------------------------------------------

        Build time: 2018-11-26 11:48:43 UTC
        Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

        Kotlin DSL: 1.0.4
        Kotlin: 1.3.10
        Groovy: 2.5.4
        Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
        JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
        OS: Linux 3.10.0-862.11.6.el7.x86_64 amd64


        $ java -version
        openjdk version "1.8.0_191"
        OpenJDK Runtime Environment (build 1.8.0_191-b12)
        OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)



      2. Windows:



        > gradlew -v                                                           

        ------------------------------------------------------------
        Gradle 5.0
        ------------------------------------------------------------

        Build time: 2018-11-26 11:48:43 UTC
        Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

        Kotlin DSL: 1.0.4
        Kotlin: 1.3.10
        Groovy: 2.5.4
        Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
        JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
        OS: Windows 10 10.0 amd64


        > java -version
        openjdk version "11.0.1" 2018-10-16
        OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
        OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)





      Global gradle.properties files on two machines are exactly same (and there is no poject-local gradle.properties file for none):



      org.gradle.daemon=true
      org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
      org.gradle.parallel=true


      (without comments)





      UPDATE 1:



      There is no problem when Gradle JVM has been set to JDK 8. But with JDK 9+ you can see the issue.





      UPDATE 2:



      I updated my Kotlin plugin from 1.3.10 to 1.3.11. Also, tested 1.3.20-eap-52. But the issue persists.





      UPDATE 3:



      I ran Gradle's compileKotlin task with --debug option to get more information. The most important parts of the output are:



      Note: Below tasks have been run when Gradle daemon was running, Kotlin compile daemon was stopped (if already running) and a little change has been made in a Kotlin source.



      I. When using JDK 8 as Gradle's JVM (OK):



      11:01:44 PM: Executing task 'compileKotlin --debug'...
      ...
      22:58:20.512 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps3085207010700515672GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
      ...
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (270393 ms old), trying to connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (270393 ms old), but no daemon, ignoring it
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (63606 ms old), trying to connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (63606 ms old), but no daemon, ignoring it
      22:58:33.515 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk1.8.0_202jrebinjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar
      22:58:33.515 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      22:58:33.516 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (277256 ms old), trying to connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (277256 ms old), but no daemon, ignoring it
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (70469 ms old), trying to connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (70469 ms old), but no daemon, ignoring it
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17507 (70 ms old), trying to connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: connected to the daemon
      22:58:33.518 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=true, modifiedFiles=[D:DevelIdeaProjectsGradleKotlinJVMsrcmainkotlinMain.kt], deletedFiles=, workingDir=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlinbuild-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain])
      22:58:33.524 [DEBUG] [sun.rmi.transport.tcp] Daemon worker: reuse connection
      ...
      22:58:35.428 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=C:UsersIAppDataLocalTempkjps6683894818132820708GradleKotlinJVM.script.xml, -classpath, D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
      ...
      11:01:53 PM: Task execution finished 'compileKotlin --debug'.


      II. When using JDK 11 as Gradle's JVM (Problem here):



      11:01:44 PM: Executing task 'compileKotlin --debug'...
      ...
      23:01:45.888 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps11452575260818015211GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
      ...
      23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
      23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
      23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
      23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
      23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      23:01:48.137 [WARN] [org.gradle.api.Project] Could not perform incremental compilation: Could not connect to Kotlin compile daemon
      23:01:48.137 [WARN] [org.gradle.api.Project] Could not connect to kotlin daemon. Using fallback strategy.
      23:01:49.486 [LIFECYCLE] [system.err]
      23:01:49.486 [ERROR] [system.err] logging: using Kotlin home directory <no_path>
      23:01:49.521 [ERROR] [system.err] logging: configuring the compilation environment
      23:01:50.538 [ERROR] [system.err] logging: loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]
      23:01:53.459 [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified
      ...
      11:01:53 PM: Task execution finished 'compileKotlin --debug'.


      III. When using JDK 11 as Gradle's JVM, but on Linux (OK):



      $ ./gradlew compileKotlin --debug
      ...
      01:33:20.145 [INFO] [org.gradle.api.Task] i: starting the daemon as: /usr/local/jdk-11.0.1/bin/java -cp /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath /usr/share/nginx/html/0xy/.kotlin/daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar
      01:33:20.145 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
      01:33:20.145 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      01:33:20.145 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      01:33:20.145 [INFO] [org.gradle.api.Task] i: found daemon on port 17613 (56 ms old), trying to connect
      01:33:20.145 [INFO] [org.gradle.api.Task] i: connected to the daemon
      01:33:20.145 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin/build-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[/usr/share/nginx/html/0xy/test/build/classes/kotlin/main])
      ...
      01:33:21.920 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=/tmp/kjps15100965302804914597GradleKotlinJVM.script.xml, -classpath, /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.10/71d0fa967493eb76648b575edf1762cb2d0c7f10/kotlin-stdlib-jdk8-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.10/4d147bf43060dc43d61b096e24da1e67dfe0c032/kotlin-stdlib-jdk7-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-compiler-embeddable/1.3.10/e96a6125793c4ab0258119fcdce9d182f42d32b0/kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
      ...


      There are some suspected events in the above logs (second), but I can't exactly understand the meaning of them and that they are related to my problem or not:




      1. Why two (exactly equal) tries has occurred to start Kotlin compile daemon?

      2. There are some errors. But they are all after warnings about Kotlin's daemon problem.


      3. The latest error/warning:



        [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified


        is the most suspected thing! Because it's the only message you can't find in other logs. Also see here. I asked about it in another post.












      share|improve this question
















      When I try a task that involves a compileKotlin (or compileTestKotlin), then I receive this warning and the result is unpleasant long duration of the build process:




      Could not perform incremental compilation: Could not connect to Kotlin compile daemon



      Could not connect to kotlin daemon. Using fallback strategy.






      I'm not sure the issue is related to my OS (Windows) or not, but I have the same project (with synchronized files) on a remote machine with Linux OS and the issue doesn't exist there. See below comparison:





      1. The project on my remote machine (Linux) with a little change in Kotlin sources (in one module):



        $ ./gradlew build

        Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
        Use '--warning-mode all' to show the individual deprecation warnings.
        See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

        BUILD SUCCESSFUL in 5s
        46 actionable tasks: 17 executed, 29 up-to-date



      2. Same project on my local machine (Windows) with same change:



        > gradlew build                                                                                       

        > Task :backend:compileKotlin
        Could not perform incremental compilation: Could not connect to Kotlin compile daemon
        Could not connect to kotlin daemon. Using fallback strategy.

        warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified

        Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
        Use '--warning-mode all' to show the individual deprecation warnings.
        See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

        BUILD SUCCESSFUL in 14s
        46 actionable tasks: 17 executed, 29 up-to-date



      Especially see build duration time in above two samples (and the warning after compileKotlin task on Windows machine). Even though my local machine (Windows) has more powerful hardware, but the result is the opposite (Gradle daemon is running on both).





      In order to further analyzability I also publish the output of gradle -v and java -version on both machines:





      1. Linux:



        $ ./gradlew -v

        ------------------------------------------------------------
        Gradle 5.0
        ------------------------------------------------------------

        Build time: 2018-11-26 11:48:43 UTC
        Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

        Kotlin DSL: 1.0.4
        Kotlin: 1.3.10
        Groovy: 2.5.4
        Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
        JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
        OS: Linux 3.10.0-862.11.6.el7.x86_64 amd64


        $ java -version
        openjdk version "1.8.0_191"
        OpenJDK Runtime Environment (build 1.8.0_191-b12)
        OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)



      2. Windows:



        > gradlew -v                                                           

        ------------------------------------------------------------
        Gradle 5.0
        ------------------------------------------------------------

        Build time: 2018-11-26 11:48:43 UTC
        Revision: 7fc6e5abf2fc5fe0824aec8a0f5462664dbcd987

        Kotlin DSL: 1.0.4
        Kotlin: 1.3.10
        Groovy: 2.5.4
        Ant: Apache Ant(TM) version 1.9.13 compiled on July 10 2018
        JVM: 11.0.1 (Oracle Corporation 11.0.1+13)
        OS: Windows 10 10.0 amd64


        > java -version
        openjdk version "11.0.1" 2018-10-16
        OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
        OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)





      Global gradle.properties files on two machines are exactly same (and there is no poject-local gradle.properties file for none):



      org.gradle.daemon=true
      org.gradle.jvmargs=-Xmx1536m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
      org.gradle.parallel=true


      (without comments)





      UPDATE 1:



      There is no problem when Gradle JVM has been set to JDK 8. But with JDK 9+ you can see the issue.





      UPDATE 2:



      I updated my Kotlin plugin from 1.3.10 to 1.3.11. Also, tested 1.3.20-eap-52. But the issue persists.





      UPDATE 3:



      I ran Gradle's compileKotlin task with --debug option to get more information. The most important parts of the output are:



      Note: Below tasks have been run when Gradle daemon was running, Kotlin compile daemon was stopped (if already running) and a little change has been made in a Kotlin source.



      I. When using JDK 8 as Gradle's JVM (OK):



      11:01:44 PM: Executing task 'compileKotlin --debug'...
      ...
      22:58:20.512 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps3085207010700515672GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
      ...
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (270393 ms old), trying to connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (270393 ms old), but no daemon, ignoring it
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (63606 ms old), trying to connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.515 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (63606 ms old), but no daemon, ignoring it
      22:58:33.515 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk1.8.0_202jrebinjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar;C:Program FilesJavaopenjdk1.8.0_202libtools.jar
      22:58:33.515 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      22:58:33.516 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17519 (277256 ms old), trying to connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-23-50.118Z.ef9f56f7564e12d191d0ba8e50b581f8.17519.run' (277256 ms old), but no daemon, ignoring it
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17502 (70469 ms old), trying to connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: cannot connect to registry: Connection refused: connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found fresh run file 'C:UsersIAppDataLocalkotlindaemonkotlin-daemon.2019-01-06T19-27-16.900Z.ef9f56f7564e12d191d0ba8e50b581f8.17502.run' (70469 ms old), but no daemon, ignoring it
      22:58:33.516 [INFO] [org.gradle.api.Task] i: found daemon on port 17507 (70 ms old), trying to connect
      22:58:33.516 [INFO] [org.gradle.api.Task] i: connected to the daemon
      22:58:33.518 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=true, modifiedFiles=[D:DevelIdeaProjectsGradleKotlinJVMsrcmainkotlinMain.kt], deletedFiles=, workingDir=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=D:DevelIdeaProjectsGradleKotlinJVMbuildkotlincompileKotlinbuild-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain])
      22:58:33.524 [DEBUG] [sun.rmi.transport.tcp] Daemon worker: reuse connection
      ...
      22:58:35.428 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=C:UsersIAppDataLocalTempkjps6683894818132820708GradleKotlinJVM.script.xml, -classpath, D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
      ...
      11:01:53 PM: Task execution finished 'compileKotlin --debug'.


      II. When using JDK 11 as Gradle's JVM (Problem here):



      11:01:44 PM: Executing task 'compileKotlin --debug'...
      ...
      23:01:45.888 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:UsersIAppDataLocalTempkjps11452575260818015211GradleKotlinJVM.script.xml -classpath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk81.3.1071d0fa967493eb76648b575edf1762cb2d0c7f10kotlin-stdlib-jdk8-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-jdk71.3.104d147bf43060dc43d61b096e24da1e67dfe0c032kotlin-stdlib-jdk7-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -d D:DevelIdeaProjectsGradleKotlinJVMbuildclasseskotlinmain -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-scripting-compiler-embeddable1.3.10e96a6125793c4ab0258119fcdce9d182f42d32b0kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
      ...
      23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
      23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
      23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:Program FilesJavaopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
      23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
      23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      23:01:48.137 [WARN] [org.gradle.api.Project] Could not perform incremental compilation: Could not connect to Kotlin compile daemon
      23:01:48.137 [WARN] [org.gradle.api.Project] Could not connect to kotlin daemon. Using fallback strategy.
      23:01:49.486 [LIFECYCLE] [system.err]
      23:01:49.486 [ERROR] [system.err] logging: using Kotlin home directory <no_path>
      23:01:49.521 [ERROR] [system.err] logging: configuring the compilation environment
      23:01:50.538 [ERROR] [system.err] logging: loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]
      23:01:53.459 [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified
      ...
      11:01:53 PM: Task execution finished 'compileKotlin --debug'.


      III. When using JDK 11 as Gradle's JVM, but on Linux (OK):



      $ ./gradlew compileKotlin --debug
      ...
      01:33:20.145 [INFO] [org.gradle.api.Task] i: starting the daemon as: /usr/local/jdk-11.0.1/bin/java -cp /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath /usr/share/nginx/html/0xy/.kotlin/daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.3.10/adc9e577de39fba3db6d60662892118afedd713/kotlin-compiler-embeddable-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.10/dd02865be0351707554b16a896b766b2396cdafa/kotlin-reflect-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-runtime/1.3.10/1d2bac36f99b84e1493244f12629bc0756a3ff90/kotlin-script-runtime-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar
      01:33:20.145 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
      01:33:20.145 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
      01:33:20.145 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
      01:33:20.145 [INFO] [org.gradle.api.Task] i: found daemon on port 17613 (56 ms old), trying to connect
      01:33:20.145 [INFO] [org.gradle.api.Task] i: connected to the daemon
      01:33:20.145 [INFO] [org.gradle.api.Project] Options for KOTLIN DAEMON: IncrementalCompilationOptions(super=CompilationOptions(compilerMode=INCREMENTAL_COMPILER, targetPlatform=JVM, reportCategories=[0, 1, 2, 3, 4], reportSeverity=3, requestedCompilationResults=[0]), areFileChangesKnown=false, modifiedFiles=null, deletedFiles=null, workingDir=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin, customCacheVersionFileName='gradle-format-version.txt', customCacheVersion=4, multiModuleICSettings=MultiModuleICSettings(buildHistoryFile=/usr/share/nginx/html/0xy/test/build/kotlin/compileKotlin/build-history.bin, useModuleDetection=false), usePreciseJavaTracking=truelocalStateDirs=[/usr/share/nginx/html/0xy/test/build/classes/kotlin/main])
      ...
      01:33:21.920 [DEBUG] [org.gradle.api.Project] [KOTLIN] [IC] compiling with args: [-Xadd-compiler-builtins, -Xbuild-file=/tmp/kjps15100965302804914597GradleKotlinJVM.script.xml, -classpath, /usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.10/71d0fa967493eb76648b575edf1762cb2d0c7f10/kotlin-stdlib-jdk8-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.10/4d147bf43060dc43d61b096e24da1e67dfe0c032/kotlin-stdlib-jdk7-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.10/b178c1501609c6e4ee8be635513cb023a466457d/kotlin-stdlib-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.10/1b19d99229dcedad7caf50534dce38fe82845269/kotlin-stdlib-common-1.3.10.jar:/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar, -jvm-target, 1.8, -Xload-builtins-from-dependencies, -module-name, GradleKotlinJVM, -no-reflect, -no-stdlib, -Xplugin=/usr/share/nginx/html/0xy/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-compiler-embeddable/1.3.10/e96a6125793c4ab0258119fcdce9d182f42d32b0/kotlin-scripting-compiler-embeddable-1.3.10.jar, -Xreport-output-files, -verbose]
      ...


      There are some suspected events in the above logs (second), but I can't exactly understand the meaning of them and that they are related to my problem or not:




      1. Why two (exactly equal) tries has occurred to start Kotlin compile daemon?

      2. There are some errors. But they are all after warnings about Kotlin's daemon problem.


      3. The latest error/warning:



        [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified


        is the most suspected thing! Because it's the only message you can't find in other logs. Also see here. I asked about it in another post.









      windows gradle kotlin compilation daemon






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 8 at 0:39







      Mir-Ismaili

















      asked Dec 31 '18 at 12:10









      Mir-IsmailiMir-Ismaili

      2,1701438




      2,1701438
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Finally, I found the source of the issue ... After some days!



          I found out the issue is from my user account. So decided to revert any user-dependent thing to its first state. During clearing Temp folder (in AppDatalocal) accidentally I saw these files:



          kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log
          kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log


          Yes! The problem has come from unicode encoding issues (probably between NTFS and UTF-8)! Although these are log files and maybe not important their names, this issue can exist somewhere else!



          As you can guess, damaged part of file names are date & time. So (unfortunately) I forced to revert my personalizations of Windows user account's date & time formats from my favorite (Persian (Iran)) to English (United States):



          enter image description here



          And the problem solved immediately:



          > wmic process where "name='java.exe'" get processId, executablePath, commandLine /format:list

          CommandLine=D:DevelJDKopenjdk-11.0.1binjava.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp D:Devel.gradlewrapperdistsgradle-5.0-all4mxuau4c77thx8zlvtz4xiez7gradle-5.0libgradle-launcher-5.0.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.0
          ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
          ProcessId=9168

          CommandLine=D:DevelJDKopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
          ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
          ProcessId=12088


          The second process is Kotlin compile daemon.





          Also log files:



          kotlin-daemon.2019-01-08.03-51-11-111.00.log
          kotlin-daemon.2019-01-08.03-51-11-111.00.log.lck


          (Note that .log.lck file didn't exist in previous state!)






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53987359%2fgradle-couldnt-connect-to-kotlin-daemon-on-windows%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Finally, I found the source of the issue ... After some days!



            I found out the issue is from my user account. So decided to revert any user-dependent thing to its first state. During clearing Temp folder (in AppDatalocal) accidentally I saw these files:



            kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log
            kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log


            Yes! The problem has come from unicode encoding issues (probably between NTFS and UTF-8)! Although these are log files and maybe not important their names, this issue can exist somewhere else!



            As you can guess, damaged part of file names are date & time. So (unfortunately) I forced to revert my personalizations of Windows user account's date & time formats from my favorite (Persian (Iran)) to English (United States):



            enter image description here



            And the problem solved immediately:



            > wmic process where "name='java.exe'" get processId, executablePath, commandLine /format:list

            CommandLine=D:DevelJDKopenjdk-11.0.1binjava.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp D:Devel.gradlewrapperdistsgradle-5.0-all4mxuau4c77thx8zlvtz4xiez7gradle-5.0libgradle-launcher-5.0.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.0
            ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
            ProcessId=9168

            CommandLine=D:DevelJDKopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
            ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
            ProcessId=12088


            The second process is Kotlin compile daemon.





            Also log files:



            kotlin-daemon.2019-01-08.03-51-11-111.00.log
            kotlin-daemon.2019-01-08.03-51-11-111.00.log.lck


            (Note that .log.lck file didn't exist in previous state!)






            share|improve this answer






























              0














              Finally, I found the source of the issue ... After some days!



              I found out the issue is from my user account. So decided to revert any user-dependent thing to its first state. During clearing Temp folder (in AppDatalocal) accidentally I saw these files:



              kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log
              kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log


              Yes! The problem has come from unicode encoding issues (probably between NTFS and UTF-8)! Although these are log files and maybe not important their names, this issue can exist somewhere else!



              As you can guess, damaged part of file names are date & time. So (unfortunately) I forced to revert my personalizations of Windows user account's date & time formats from my favorite (Persian (Iran)) to English (United States):



              enter image description here



              And the problem solved immediately:



              > wmic process where "name='java.exe'" get processId, executablePath, commandLine /format:list

              CommandLine=D:DevelJDKopenjdk-11.0.1binjava.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp D:Devel.gradlewrapperdistsgradle-5.0-all4mxuau4c77thx8zlvtz4xiez7gradle-5.0libgradle-launcher-5.0.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.0
              ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
              ProcessId=9168

              CommandLine=D:DevelJDKopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
              ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
              ProcessId=12088


              The second process is Kotlin compile daemon.





              Also log files:



              kotlin-daemon.2019-01-08.03-51-11-111.00.log
              kotlin-daemon.2019-01-08.03-51-11-111.00.log.lck


              (Note that .log.lck file didn't exist in previous state!)






              share|improve this answer




























                0












                0








                0







                Finally, I found the source of the issue ... After some days!



                I found out the issue is from my user account. So decided to revert any user-dependent thing to its first state. During clearing Temp folder (in AppDatalocal) accidentally I saw these files:



                kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log
                kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log


                Yes! The problem has come from unicode encoding issues (probably between NTFS and UTF-8)! Although these are log files and maybe not important their names, this issue can exist somewhere else!



                As you can guess, damaged part of file names are date & time. So (unfortunately) I forced to revert my personalizations of Windows user account's date & time formats from my favorite (Persian (Iran)) to English (United States):



                enter image description here



                And the problem solved immediately:



                > wmic process where "name='java.exe'" get processId, executablePath, commandLine /format:list

                CommandLine=D:DevelJDKopenjdk-11.0.1binjava.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp D:Devel.gradlewrapperdistsgradle-5.0-all4mxuau4c77thx8zlvtz4xiez7gradle-5.0libgradle-launcher-5.0.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.0
                ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
                ProcessId=9168

                CommandLine=D:DevelJDKopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
                ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
                ProcessId=12088


                The second process is Kotlin compile daemon.





                Also log files:



                kotlin-daemon.2019-01-08.03-51-11-111.00.log
                kotlin-daemon.2019-01-08.03-51-11-111.00.log.lck


                (Note that .log.lck file didn't exist in previous state!)






                share|improve this answer















                Finally, I found the source of the issue ... After some days!



                I found out the issue is from my user account. So decided to revert any user-dependent thing to its first state. During clearing Temp folder (in AppDatalocal) accidentally I saw these files:



                kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log
                kotlin-daemon.Û²Û°Û±Û¹-Û°Û±-Û°Û¸.Û°Û³-ÛµÛ´-Û±Û²-Û¶Û´Û¸.00.log


                Yes! The problem has come from unicode encoding issues (probably between NTFS and UTF-8)! Although these are log files and maybe not important their names, this issue can exist somewhere else!



                As you can guess, damaged part of file names are date & time. So (unfortunately) I forced to revert my personalizations of Windows user account's date & time formats from my favorite (Persian (Iran)) to English (United States):



                enter image description here



                And the problem solved immediately:



                > wmic process where "name='java.exe'" get processId, executablePath, commandLine /format:list

                CommandLine=D:DevelJDKopenjdk-11.0.1binjava.exe -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.prefs/java.util.prefs=ALL-UNNAMED -Xmx1536m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp D:Devel.gradlewrapperdistsgradle-5.0-all4mxuau4c77thx8zlvtz4xiez7gradle-5.0libgradle-launcher-5.0.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.0
                ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
                ProcessId=9168

                CommandLine=D:DevelJDKopenjdk-11.0.1binjava -cp D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:UsersIAppDataLocalkotlindaemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-compiler-embeddable1.3.10adc9e577de39fba3db6d60662892118afedd713kotlin-compiler-embeddable-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-reflect1.3.10dd02865be0351707554b16a896b766b2396cdafakotlin-reflect-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib1.3.10b178c1501609c6e4ee8be635513cb023a466457dkotlin-stdlib-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-script-runtime1.3.101d2bac36f99b84e1493244f12629bc0756a3ff90kotlin-script-runtime-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrains.kotlinkotlin-stdlib-common1.3.101b19d99229dcedad7caf50534dce38fe82845269kotlin-stdlib-common-1.3.10.jar;D:Devel.gradlecachesmodules-2files-2.1org.jetbrainsannotations13.0919f0dfe192fb4e063e7dacadee7f8bb9a2672a9annotations-13.0.jar
                ExecutablePath=D:DevelJDKopenjdk-11.0.1binjava.exe
                ProcessId=12088


                The second process is Kotlin compile daemon.





                Also log files:



                kotlin-daemon.2019-01-08.03-51-11-111.00.log
                kotlin-daemon.2019-01-08.03-51-11-111.00.log.lck


                (Note that .log.lck file didn't exist in previous state!)







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 8 at 1:43

























                answered Jan 8 at 1:09









                Mir-IsmailiMir-Ismaili

                2,1701438




                2,1701438
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53987359%2fgradle-couldnt-connect-to-kotlin-daemon-on-windows%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    NZ,UeBor2BO X06u 0hXAJnrbthYpX6ZvDzi9K
                    rf9e4Yfov7zUifLPcMGhTzjE8GgSTa

                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas