I have encountered this situation several times, thinking that I must write it down, or I will have to slowly find the solution in the future. A
red J logo appears in the lower left corner of the IDEA java class file, as shown in the figure:
Solution:
File>>project structure>>Modules