Under the target folder in IntelliJ for a Java project I created, I have a few java source files in the package. Beside each file the \'J\' icon has a red circle with a lin
It means your Java source files aren't part of the project.
If the suggestions mentioned here don't resolve the issue, you may have hit a rare bug like I did. Researching the exceptions found in the log helped me. In my case, disabling the "Plugin DevKit", deleting the .idea directory, and reimporting the project worked.
mark the java folder as source root.It will solve.
For a gradle project "./gradlew --stop" will help to resolve the problem when the source directory is correctly specified and project is properly synced.
As mentioned earlier,
This is what worked for me
You need to specify the source dir
File> Project Structure > Modules
click the directory and click the Sources button
It's weird because usually it's done automatically. Maybe it's better if you recreate the project again.