Cannot resolve symbol in IntelliJ
If you open a Java project for the first time in IntelliJ, and you’re greeted with a bunch of unresolved classes and keywords, highlighted in red like this (yuck!):
It might be because IntelliJ hasn’t correctly recognised the project as a Maven project.
To confirm this, have a look at the
pom.xml file icon. If it’s just shown as a normal XML icon like this:
Then you’ll need to specifically tell IntelliJ to read the file as a Maven project, by right-clicking the
pom.xml file and choosing this option:
Now IntelliJ should show your
pom.xml with a proper Maven icon:
And then… Maven will go do stuff and resolve dependencies.
Now is a good time to get a cup of coffee. ;-)
What do you think? You can use Markdown in your comment.
To write code, indent each line with 4 spaces. Or, to paste a lot of code, you can put it in pastebin.com and share the link in your comment.