IntelliJ doesn't recognize java project after cloning IntelliJ doesn't recognize java project after cloning git git

IntelliJ doesn't recognize java project after cloning


You have to mark your src directory as Source Root.

Right-click on the src folder and select Sources Root:

enter image description here

Then you'll see that the icons will change:

enter image description here



EDIT

Check the output path by bringing up the Project Structure view.

Press Ctrl+Alt+Shift+S

enter image description here


Similar to what maba said above, but if applicable you probably want to mark main and test as source & test source directories (respectively). That's a common project directory structure where literally marking src (parent of main and test) as source won't work for you.


Yes, marking src folder as 'Source Root' resolved the issue. Earlier intellij was not detecting java files.

Go to: Right Click --> src --> (Choose option) Mark Directory as --> Source Root.