Intellij IDEA编译代码出现红色标志

如图

 

原因:项目没有模块化加载

解决方法:

快捷键 Ctrl+Alt+Shift+S 进入 Project Structure 界面,选择 Modules --> Sources -->选择项目的 src 原文件目录 --> Mark as --> Sources --> Apply --> OK

 

 

原文地址:https://www.cnblogs.com/skyessay/p/6396585.html