IntelliJ Stuck in Rebuild Loop
已回答
I have a trivial Java project with 2 .java files.
https://github.com/sirianni/ijbug
IntellIJ is constantly building the project even though I am making no changes. I have restarted IntelliJ and invalidated caches and the problem persists. Here are the idea.log and build.log files:
2017-09-15 16:58:29,573 [ 150819] INFO - j.compiler.server.BuildManager - Using preloaded build process to compile /home/esirianni/src/ijbug
2017-09-15 16:58:30,972 [ 152218] INFO - CompilerBackwardReferenceIndex - backward reference index version differ due to: class java.io.FileNotFoundException
2017-09-15 16:58:30,972 [ 152218] INFO - s.CompilerReferenceServiceImpl - backward reference index reader doesn't exist
2017-09-15 16:58:31,215 [ 152461] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /opt/idea-IC-172.3757.52/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar:/opt/idea-IC-172.3757.52/lib/optimizedFileManager.jar:/opt/idea-IC-172.3757.52/lib/ecj-4.6.2.jar
2017-09-15 16:58:31,330 [ 152576] INFO - j.compiler.server.BuildManager - Using preloaded build process to compile /home/esirianni/src/ijbug
2017-09-15 16:58:32,651 [ 153897] INFO - CompilerBackwardReferenceIndex - backward reference index version differ due to: class java.io.FileNotFoundException
2017-09-15 16:58:32,651 [ 153897] INFO - s.CompilerReferenceServiceImpl - backward reference index reader doesn't exist
2017-09-15 16:58:32,868 [ 154114] INFO - j.compiler.server.BuildManager - BUILDER_PROCESS [stdout]: Build process started. Classpath: /opt/idea-IC-172.3757.52/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar:/opt/idea-IC-172.3757.52/lib/optimizedFileManager.jar:/opt/idea-IC-172.3757.52/lib/ecj-4.6.2.jar
2017-09-15 16:58:19,103 [ 311] INFO - etbrains.jps.cmdline.BuildMain - Connection to IDE established in 261 ms
2017-09-15 16:58:19,192 [ 400] INFO - jps.cmdline.JpsModelLoaderImpl - Loading model: project path = /home/esirianni/src/ijbug, global options path = /home/esirianni/.IdeaIC2017.2/config/options
2017-09-15 16:58:19,467 [ 675] INFO - jps.cmdline.JpsModelLoaderImpl - Model loaded in 275 ms
2017-09-15 16:58:19,467 [ 675] INFO - jps.cmdline.JpsModelLoaderImpl - Project has 3 modules, 32 libraries
2017-09-15 16:58:19,604 [ 812] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=602
2017-09-15 16:58:19,724 [ 932] INFO - etbrains.jps.cmdline.BuildMain - Pre-loaded process ready in 933 ms
2017-09-15 16:58:19,802 [ 1010] INFO - .incremental.IncProjectBuilder - Building project; isRebuild:false; isMake:true parallel compilation:false
2017-09-15 16:58:19,804 [ 1012] INFO - kotlin.jps.build.KotlinBuilder - is Kotlin incremental compilation enabled: true
2017-09-15 16:58:19,804 [ 1012] INFO - kotlin.jps.build.KotlinBuilder - is Kotlin experimental incremental compilation enabled: true
2017-09-15 16:58:19,830 [ 1038] INFO - kotlin.jps.build.KotlinBuilder - is Kotlin compiler daemon enabled: true
2017-09-15 16:58:19,840 [ 1048] INFO - .incremental.IncProjectBuilder - Cleaned output directories in 2 ms
2017-09-15 16:58:19,921 [ 1129] INFO - s.incremental.java.JavaBuilder - Compiling 1 java files; module: ijbug_test (tests)
2017-09-15 16:58:20,383 [ 1591] INFO - brains.jps.incremental.Builder - Dependency analysis found 0 affected files
2017-09-15 16:58:20,446 [ 1654] INFO - rains.jps.cmdline.BuildSession - Build duration: 'java' builder took 437 ms, 1 sources processed
2017-09-15 16:58:20,448 [ 1656] INFO - s.incremental.java.JavaBuilder - Eclipse compiler 4.6.2 was used to compile [ijbug_test]
2017-09-15 16:58:20,795 [ 0] INFO - etbrains.jps.cmdline.BuildMain - Build process started. Classpath: /opt/idea-IC-172.3757.52/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar:/opt/idea-IC-172.3757.52/lib/optimizedFileManager.jar:/opt/idea-IC-172.3757.52/lib/ecj-4.6.2.jar
2017-09-15 16:58:20,894 [ 99] INFO - til.internal.PlatformDependent - Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
2017-09-15 16:58:21,081 [ 286] INFO - etbrains.jps.cmdline.BuildMain - Connection to IDE established in 231 ms
2017-09-15 16:58:21,161 [ 366] INFO - jps.cmdline.JpsModelLoaderImpl - Loading model: project path = /home/esirianni/src/ijbug, global options path = /home/esirianni/.IdeaIC2017.2/config/options
2017-09-15 16:58:21,398 [ 603] INFO - jps.cmdline.JpsModelLoaderImpl - Model loaded in 237 ms
2017-09-15 16:58:21,398 [ 603] INFO - jps.cmdline.JpsModelLoaderImpl - Project has 3 modules, 32 libraries
2017-09-15 16:58:21,488 [ 693] INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=602
2017-09-15 16:58:21,599 [ 804] INFO - etbrains.jps.cmdline.BuildMain - Pre-loaded process ready in 805 ms
2017-09-15 16:58:21,687 [ 892] INFO - .incremental.IncProjectBuilder - Building project; isRebuild:false; isMake:true parallel compilation:false
2017-09-15 16:58:21,690 [ 895] INFO - kotlin.jps.build.KotlinBuilder - is Kotlin incremental compilation enabled: true
2017-09-15 16:58:21,690 [ 895] INFO - kotlin.jps.build.KotlinBuilder - is Kotlin experimental incremental compilation enabled: true
2017-09-15 16:58:21,715 [ 920] INFO - kotlin.jps.build.KotlinBuilder - is Kotlin compiler daemon enabled: true
2017-09-15 16:58:21,725 [ 930] INFO - .incremental.IncProjectBuilder - Cleaned output directories in 3 ms
2017-09-15 16:58:21,814 [ 1019] INFO - s.incremental.java.JavaBuilder - Compiling 1 java files; module: ijbug_test (tests)
2017-09-15 16:58:22,294 [ 1499] INFO - brains.jps.incremental.Builder - Dependency analysis found 0 affected files
2017-09-15 16:58:22,359 [ 1564] INFO - rains.jps.cmdline.BuildSession - Build duration: 'java' builder took 466 ms, 1 sources processed
2017-09-15 16:58:22,360 [ 1565] INFO - s.incremental.java.JavaBuilder - Eclipse compiler 4.6.2 was used to compile [ijbug_test]
2017-09-15 16:58:22,651 [ 0] INFO - etbrains.jps.cmdline.BuildMain - Build process started. Classpath: /opt/idea-IC-172.3757.52/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar:/opt/idea-IC-172.3757.52/lib/optimizedFileManager.jar:/opt/idea-IC-172.3757.52/lib/ecj-4.6.2.jar
2017-09-15 16:58:22,739 [ 88] INFO - til.internal.PlatformDependent - Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system instability.
请先登录再写评论。
Please clarify the problem. When I perform Build | Build with the project you've linked IntelliJ IDEA says that all files are up to date and doesn't compile anything.
What IntelliJ IDEA version is used? Did you enable the option to delegate the build to Gradle?
Can you share the video of the problem?
Hi Serge,
I am hitting a very similar issue again with an infinite rebuild loop. This time I am using a Kotlin project.
The build.log, idea.log, screencast showing the issue and code are checked in at https://github.com/sirianni/ij-build-loop
Can you please take a look and let me know if any more information is necessary?
Try with the third-party plug-ins like .ignore disabled. Delete the system directory and rebuild (https://intellij-support.jetbrains.com/hc/articles/206544519).
Your project doesn't build on my system:
Thanks Serge. I needed to change the JVM target to 1.8 in Kotlin Settings to fix this error.
It seems to be correctly set in the module settings (presumably from reading the setting from build.gradle) but I still needed to set it here.
I am running Kotlin Plugin version 1.2.21-release-IJ2017.3-1
Strangely, I can't reproduce the issue this morning... I don't know what possibly could have changed. I restarted the IDE and invalidated caches several times last night to no avail.
The problem seems to happen whenever I create a new Kotlin project. I have disabled all plugins and deleted the system directory - that does not fix the problem.
The problem goes away if I enable "Power Save" mode. Unfortunately, when I disable "Power Save" mode, the problem returns.
Please file the bug at https://youtrack.jetbrains.com/issues/IDEA.