I'm using Intellij IDEA for work on a Java project.
I'm finding I get a lot of false positives when I build in Intellij, but only when there are other compilation errors - e.g. I've made a change and expect a number of compile errors, so I build to find all the errors. (In this instance, I changed a widely used interface, and want the compiler to catch the errors so that I know which implementations to fix.) In addition to some of these expected errors, Intellij reports hundreds of false positives (which makes it difficult to find the real errors - at present the compiler is showing only one genuine compile error each time, so I have to rebuild to find the next error...). These false compile errors are not highlighted - indeed, they are not real compile errors. (Nor do they appear if I compile via Maven.)
The most common error is 'cannot find symbol class [X]', despite that class often being in the same project.
I've tried: - upgrading Intellij (from 10.5.1 to 10.5.2 to 11.0.1) - invalidating and rebuilding caches - restarting Intellij ...but all to no effect.
I've searched the Intellij Bug Tracking board, but haven't found any reference to this there, so wondered whether this is user error (if so, what settings do I need to change)?
Has anyone else experienced anything like this? If so, how did you fix it?
Basically, "Build Artifact" is a conditional build, meaning it will only build if there is any modified code. If you haven't changed anything, it won't do anything. "Rebuild Artifact", however, will force a build from scratch no matter if there are code changes or not.
Show all errors in one place:The Problems tool window appears if the Make project automatically option is enabled in the Compiler settings. It shows a list of problems that were detected on project compilation.
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Compiler. On the Compiler page, select Build project automatically. Now when you make changes in the class files, IntelliJ IDEA automatically performs the incremental build of the project.
This is probably too late to help you, but maybe it will help somebody else. I had a similar problem. IntelliJ complained that it couldn't find a symbol class, and the class it couldn't find had an icon with a little x in the upper left hand corner. The x indicates that the class was excluded from compilation. (I have no idea how that happened.)
To include the excluded file, access project settings, e.g., by clicking Ctrl+Alt+S. Then you can modify the list found under Project Settings -> Compiler -> Excludes, to re-include the excluded file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With