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.
I'm getting the usual highlighted errors. On every declaration:
Cannot resolve symbol SomeEntityBean/Bean
and on every method:
Cannot resolve method SomeFunction()
How do I fix these false errors?
These 3 steps almost always work for me :
Step 1 -
File -> Invalidate cache/ Restart
Step 2- If you see that in
File -> Project Structure -> SDKs
the SDK is red, Try to configure it properly as explained hereStep 3 - Update Java versions in
I was trying to use all the advices above, but unfortunately no one helped me. So finally I've decided to delete my intelij workspace and create the new one - it helped :) But earlier I was also doing cleaning the cache, reimporting maven projects, cleaning projects and rebuilding them.
I had the same issue I was using JDK 1.9 with IntelliJ 14, I solved reinstalling Java with latest version of JDK 1.8(1.8.0_161 in this case)
I also removed the 1.9 version from
HKEY_CURRENT_USER\Software\JavaSoft\JRE\Security Baseline
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).
I had the same problem after changing JDK from 1.6 to 1.7 in my pom.xml and setting Maven 3 path + JDK project settings to 1.7.
What did it for me was => File -> Invalidate Caches and Restart
PS: problem occured again, so i just reimported the full project after deleting the .idea folder and now it works fine as usual :)
I had the same problem.
In my case the problem was with maven
home directory
anduser settings file
in Intellij Settings under Maven. I had installed Maven not in the default directory and I had also changed the location of thesettings.xml
file. This should also be changed in the IntelliJ Settings.Hope this helps also.