Verify that the scope of the library (in the project structure window) is Compile . If set to a scope of Provided it will cause the behavior you describe. If you have a dependency under a maven profile, make sure you select the correct profile in the maven tree "Profiles", when you compile the project.
somethingElse the compiler assumes you are doing a packageName. classname . In this case you were intending to access out of the System class, but you could very well be trying to access a package called system that is not present (in the classpath for instance). So it is a guess from a compiler.
Just reimport didn't work. Following worked for me.
File -> Invalidate Caches /Restart
Then
Build -> Rebuild Project
That will reimport maven project.
Note : You need to invalidate the cache AND ALSO rebuild the project.
I tried to "Maven > Reimport" but the only thing that actually fixed it was to close the project, delete the .idea directory, and reopen the project.
Right click your project / Maven (at bottom) / Reimport
Edit, much later: I also saw this happen much more frequently when I had the Clover plugin installed. Drop that plugin like a bad habit!
None of the 13 existing answers worked for me. However, I could resolve the issue by first removing all modules:
File
> Project Structure...
,Modules
tab,then removing all remaining Maven modules from Maven
tool window:
Remove projects
,and then adding them again in Project
tool window:
pom.xml
,Add as Maven project
,now unignoring any ignored modules from Maven
tool window:
Unignore
,and finally rebuilding using Build
> Rebuild project
. This assumes that a mvn clean install
already happened.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With