IntelliJ highlights errors that don't exist

已回答

These last days, IntelliJ is not working properly. For instance:

http://i.imgur.com/gtVwi.png

The method receives a String as parameter but it shows an error there. Compilation works fine, but it's annoying to have error markers on my code everywhere. Sometimes restarting the IDE makes it work (closing the file and reopening does not help)... so, is there a way to fix this problem?

0

@Steffy what settings are those? Is this related to the issue discussed here?

0
Avatar
Permanently deleted user

After upgrading from IntelliJ Community version 2018.2 to IntelliJ Community version 2019.1, I had the same issue on Mac OS Mojave with JDK 8. 

Recreated the JDK in new version, and did the Invalidate cache/Restart and that solved the issue. 

0
Avatar
Permanently deleted user

Got this error, no matter what I did: invalid/restart, reboot, download latest version etc., still there. Wasted a lot of time. But eventually go it figured it out. Stupid errors like this make me miss eclipse.

For people still bothered by this.

Fix is just delete .idea directory and reimport project.

 

 

0

Having this problem in 2021.1. Unloading the module and loading it back fixed it for me.

0

Sometimes going to the files in question and hitting save does the trick when all else fails

0

请先登录再写评论。