Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA, how to update resources on a local server (Tomcat)?

If I change a java file / servlet, press run and pick update classes and resources, the old file is still used when I open the browser. If instead I pick rerun server (tomcat), the updated version of the file is loaded.

I could restart the server every time I change a file, but that is slow and seems clumsy. How should I go about loading the updated version of the java file?

like image 513
abc32112 Avatar asked Aug 30 '25 15:08

abc32112


1 Answers

If your webapp in debug mode, changes to your jsp and some changes to your classes (no method signature changes) can be hot redeployed without having to restart your tomcat server.

Once your tomcat is started in debug mode, go to the debug view click on the blue arrow (see picture below), then you have the choice to

  • update resources
  • update classes and resources
  • redeploy
  • restart the server

if you just changed jsp file, update resources should be enough. if you changed a class without changing method signature, update classes and ressources, should be enough and class should be reloaded. If you change, add methods, then you need to redeploy your webapplication.

enter image description here

like image 145
Frederic Close Avatar answered Sep 02 '25 20:09

Frederic Close