Class not found in module warning when try to create Run/Debug Configuration in Intellij
The way I fixed the problem was to remove the existing Content Root from the project and adding a new one. For some reason, it looks like it got corrupted.
File->Project Structure under Modules : then on the far right side of the screen where it says Add Content Root, remove the existing Content Root and add it back again pointing to the correct location.
None of the above worked, I had to do: File -> Invalidate Caches/ Restart... Upon restart it reindexed all files and everything worked.
I'll explain a little bit more detailed version of the Accepted answer.
Open
Project structure
window (UsingCtrl+Shift+Alt+S
shortkey or FromFile -> Project structure
option in the IDE menu)From there, select
modules
tab and remove the current configuration you have.
- Import module again.
- Select the root of your module (The old
.iml
file should be in that folder)
A dialog will popup. Select default options and finish.
Apply the modifications by clicking OK.