Created: 2012-08-21 09:16
Updated: 2015-11-05 16:06


Testing code hotswapping with java and an ant extension ( ), without eclipse/any IDE. This is supposed to be a barebones project just to demo it.

There is a section on the build.xml file dedicated to make this work with tomcat but it's untested.

#Thanks to Christopher Wellons blog post about hot code replacement( ) and the example provided by him:

#How to

  1. Install ant if you dont have it.
  2. Download hotswap.jar from
  3. Add hotswap.jar to /home/user/.ant/lib/ or ANT_HOME/lib or use -lib hotswap.jar when running ant (put the file in the same folder as the ant script).
  4. run(in the same folder as the build.xml file): ant run-hotswap
  5. Your application should be running now.
  6. Make changes to the class
  7. run it with - ant hotswap
  8. You should see the changes applied to the output of the program
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more