Let’s take a look at how to speed up the development of our Spring Boot app by installing Trava Open JDK and use of hot-swapping.
How to set hot swap with Trava Open JDK in your IntelliJ Idea
- Install to your computer Trava Open JDK. You can find installation binaries at Trava Open JDK on GitHub. If you are Windows user, I would give you a tip to just download Windows binaries and unpack them to folder where you have the rest of JDKs. Exp. C:/Program files/Java/ .
- In IntelliJ Idea go to Project Structure and under Platform Settings add to SDKs Trava Open JDK. Also under Project Settings in Project SDK select Trave Open JDK as JDK for your project.
- And as last step change in IntelliJ Spring Boot runner configuration Running Application Update Policies. Change On ‘Update’ action and set it to Update classes and resources and On frame deactivation set the same to Update classes and resources. You can check image below for more details.
And that is all. You can start your app now, and your code will be hot-swapped on frame deactivation. Or you can command hot-swap manually with ctrl + shift + f9
.