The great alternative to JRebel

I'm an old user and addict of JRebel. I started to use it on open source projects and in professional contexts. From the beginning, I've been convinced that the licensing mode was wrong because of its lifetime. Asking for license renewal each year is boring. So, I decided to look for FREE alternative solutions and finally I recently found one.

This solution is efficient for maven projects developed with Eclipse. It is base on :


I tested it with Java 7 & Java 8. I work on web applications that run on Tomcat. I developed wih Spring (IoC), sometimes Hibernate and Vaadin




Hotswap Agent installation consists on the deployment of a patch for your JVM. You just have to download the corresponding patch here : https://github.com/dcevm/dcevm/releases
Then, download the hotswap-agent.jar from here : https://github.com/HotswapProjects/HotswapAgent/releases

Once it is done, it supposes that you run your project with Maven. For example, I use to start my webapp projects with mvn tomcat7:run or mvn jetty:run.  It could be done from Eclipse directly from the context menu. Thus, you will not need Eclipse WTP anymore

The only thing you will have to do is to declare the following parameters to you JVM arguments like this : 

-XXaltjvm=dcevm -javaagent:/home/depellegrin/Applications/hotswap-agent.jar=autoHotswap=true



Now, in your Java console, you will see extra logs like this :


These extra logs show your HotSwap Agent activity. This is helpfull because in some cases, hot reloading doesn't work. It also happens with JRebel, but honestly (and fortunately) in less cases than this free agent.


Dynamic Source Lookup


Next step : the debugger. If you want to hotswap code changes, you also need to debug it. But, then projects are started with Maven in debug mode (Debug As... instead of Run As... ), Eclipse doesn't link the source code with the code which is executed. To fix this problem, just install the Eclipse plugin from the menu Help > Install new software as it is explained in the project's page here : https://github.com/ifedorenko/com.ifedorenko.m2e.sourcelookup.



That's all. I hope you will enjoy your new life with dynamic reloading of code changes and enjoy the benefits of a strongly compiled programming language like Java associated with the flexibility of an interpreted language.