Why so red? IntelliJ seems to think every declaration/method cannot be found/resolved

前端 未结 28 1187
予麋鹿
予麋鹿 2020-12-12 11:22

I just installed and re-installed IntelliJ. Every Java file is coming up RED. I checked the JDK; it is at 1.6.##. The maven clean install build worked just fine

相关标签:
28条回答
  • 2020-12-12 12:01

    Tried invalidating cache, reimporting the project, switching to built-in Maven, removing the .m2 folder and its parts, - nothing worked. After I had completely broken Maven (while it had built the project successfully before, now it couldn't anymore), I had to reinstall it from scratch. It helped!

    0 讨论(0)
  • 2020-12-12 12:01

    I had the same problem and after trying all of the above suggestions, it turned out that my IntelliJ installation had not picked up my JAVA_HOME system variable, and it had no SDK/JDK set.

    I fixed it by following these instructions: Configuring Global, Project and Module SDKs

    0 讨论(0)
  • 2020-12-12 12:02

    IntelliJ sometimes gets confused all by itself, even without the external changes Korgen described (though that is a good way to consistently reproduce it).

    Click File -> Synchronize, and IntelliJ should see that everything is okay again.

    If that doesn't work, IntelliJ's caches might be corrupt (this used to happen a lot more often than it does now); in that case, regenerate them by

    Clicking File -> Invalidate Caches and restarting the IDE

    (though loading the project will take a while while the caches are recreated).

    0 讨论(0)
  • 2020-12-12 12:02

    In my case, getter and setter dependencies were coming through lombok plugin (Using java with Spring). And in the new installation of intellij idea, I had not installed the lombok plugin. Installing the lombok plugin fixed it for me.

    0 讨论(0)
  • 2020-12-12 12:02

    I had the same problem.

    In my case the problem was with maven home directory and user settings file in Intellij Settings under Maven. I had installed Maven not in the default directory and I had also changed the location of the settings.xml file. This should also be changed in the IntelliJ Settings.

    Hope this helps also.

    0 讨论(0)
  • 2020-12-12 12:02

    I spent most of a day trying all the solutions here, but nothing seemed to work. The only thing that worked for me was to completely uninstall IntelliJ and install it again. However, for me, when I deleted IntelliJ from the Application folder, the problem returned as soon as I re-installed it. What I finally had to do was to use App Cleaner to completely remove IntelliJ and all the config and settings files. After I did that and then reinstalled IntelliJ, the problem finally went away. See How to uninstall IntelliJ on a Mac

    0 讨论(0)
提交回复
热议问题