maven项目的话直接在pom.xml中dependencies内加入如下依赖
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
然后打开偏好设置,mac快捷键是command + /,搜索compiler,勾选自动编译。如图所示:
点击ok保存后,mac使用command+shift+option+/(windows是alt+ctrl+shift+/)打开 Maintenance 选择Registry
然后勾选如图选项,即可