> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iii.-using-spring-boot/20.-developer-tools/20.2.-automatic-restart/20.2.4.-disabling-restart.md).

# 20.2.4. 禁用重启

如果不想使用重启特性，你可以通过`spring.devtools.restart.enabled`属性来禁用它。通常情况下可以在`application.properties`文件中设置（依旧会初始化重启类加载器，但它不会监控文件变化）。

如果需要彻底禁用重启支持（比如，不能跟某个特殊库一块工作），你需要在调用`SpringApplication.run(…)`之前，把系统属性`spring.devtools.restart.enabled`设置为`false`，如下：

```java
public static void main(String[] args) {
    System.setProperty("spring.devtools.restart.enabled", "false");
    SpringApplication.run(MyApp.class, args);
}
```
