在Intellij IDEA中默认是关闭了自动编译的,可以按照如下1步设置开启自动编译:

1.IDEA开启项目自动编译,进入设置,Build,Execut, Deployment -> Compiler 勾选中左侧的Build Project automatically