IntelliJ IDEA's Spring Boot Hot Reload: Faster Development Without the Restart
IntelliJ IDEA's Spring Boot run configuration provides native hot-reload support through the 'Update classes and resources' action, leveraging Spring Boot DevTools to reload the application context in 1-3 seconds instead of requiring a full JVM restart.
01 Aug 2025, 01:55 UTC

The Problem: Slow Spring Boot Iteration Cycles
When developing Spring Boot applications, the traditional mvn spring-boot:run or gradle bootRun workflows require a full application restart for code changes to take effect. This cycle—code, save, restart, wait—becomes painfully slow as applications grow, breaking flow state and slowing development velocity.
IntelliJ's Built-In Solution
IntelliJ IDEA's Spring Boot run configuration provides native hot-reload support through the 'Update classes and resources' action. This feature leverages Spring Boot's spring-devtools module to automatically reload the application context when compiled classes change, typically in under a second.
Key Configuration Options
- Update classes and resources: Triggers hot reload via Spring DevTools when code changes are compiled
- On 'Enter' key: Press Enter in the console to force an immediate context refresh without waiting for file system events
- Refresh button: Manual trigger in the run configuration toolbar for explicit reload control
- Build project automatically: Enable under
Settings > Build, Execution, Deployment > Compilerfor seamless compilation
Working Example: Setting Up Hot Reload
Follow these steps to enable hot reload in your Spring Boot project:
- Verify DevTools dependency in
pom.xmlorbuild.gradle:
<!-- Maven -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
// Gradle
runtimeOnly 'org.springframework.boot:spring-boot-devtools'
- Create a new Spring Boot run configuration:
File > Edit Configurations... > + > Spring Boot
- In the configuration dialog, locate the On 'Enter' key dropdown and select Update classes and resources
- Ensure Build project automatically is enabled (
Ctrl+Shift+A, type 'Compile' to verify)
Testing the Setup
After starting the application with this configuration, modify any @Service, @Component, or controller class. The console should show a restart log entry without a full JVM restart, typically completing in 1-3 seconds.
Limitations and Trade-offs
While IntelliJ's hot reload significantly speeds up development, it has notable limitations:
| Limitation | Impact |
|---|---|
| Complex class hierarchy changes | Adding/removing fields or methods may not propagate correctly |
| Bean definition modifications | Changes to @Bean methods or configuration classes may require manual refresh |
| Third-party bean post-processors | Custom initialization logic may not survive context reloads |
| Memory consumption | Multiple contexts remain in memory during development |
Verification Checklist
Run these checks to confirm hot reload is working correctly:
- Configuration verification: Open run configuration and confirm 'Update classes and resources' is selected
- Auto-compilation check: Modify a service class and verify it compiles without manual build trigger
- Reload test: Add a log statement to a controller method and press Enter in console; changes should appear immediately
- DevTools detection: Console output should include 'Restarting application' without 'Starting application'
Actionable Next Steps
To implement this in your project:
- Enable
Build project automaticallyin Compiler settings - Create a Spring Boot run configuration with 'Update classes and resources' on Enter
- Add
spring-boot-devtoolsto your project dependencies - Use the Enter key in the console for immediate reload during active development
Limitation: Hot reload cannot replace full restarts for all change types. When encountering unexpected behavior, a full application restart remains the reliable fallback.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.