File>>Project Structure>>Modules>>在java目录上右击sources>>点击确定即可
参考:https://blog.csdn.net/weixin_42957931/article/details/108836303