BrownTownCoder
BrownTownCoder

Reputation: 1372

IntelliJ does not detect java classes from a different package

IntelliJ suddenly does not recognize classes from a different package and turns them red. Weirdly though, since those objects are there, I am having no issue compiling and running everything. Any idea what might be causing it and how can I rectify this?

Thanks

Upvotes: 0

Views: 2916

Answers (1)

Laurentiu L.
Laurentiu L.

Reputation: 6686

If you project compiles that must mean you have your dependencies properly set in your POM.

Try showing the list of available intention actions for the class you see as red and check the import options or dependency suggestions.

Although this is probably a problem of caches. After invalidating cache as Rafael suggested, try reimporting your maven projects. And if you haven't already, tick the auto-import option.

If that stil doesn't work you can try checking out your code out of your version control repo or simply copying only your source code folders or cleaning your project and importing it again in IDEA.

Upvotes: 1

Related Questions