Trying to create a Run configuration in Intellij For a Java application and get a warning that Class not found in module and it doesn't create the Run configuration. This only happened once I added the project to BitBucket. Before that it ran fine.
From the main menu, select Run | Edit Configurations. Alternatively, press Alt+Shift+F10 , then 0 . on the toolbar or press Alt+Insert . The list shows the run/debug configuration templates.
Open the Run/Debug Configuration dialog in one of the following ways: Select Run | Edit Configurations from the main menu. With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector. Press Alt+Shift+F10 and then press 0 .
Select the top-level directory in the Project tool window and press Alt+Insert or select New | Module from the context menu. The New Module wizard opens. From the list on the left, select a module type. Name the new module.
2) "Run" menu -> " Edit configuration " -> delete the profile -> add back the profile ("Application" if it's a Java application), choose your main class from the "Main Class" dropdown menu. 3)"Build" menu -> " Rebuild Project ". Show activity on this post. Then open the project with IntelliJ.
None of the above worked, I had to do:
File -> Invalidate Caches/ Restart
Upon restart it re-indexed all files and everything worked again as expected.
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.
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