We are using JRebel at work now for a couple of weeks, and this product is really a timesaver for every Java developer. No need to redeploy/restart your application server: just code and push refresh in the browser.
But, we sometimes had the issue the whole project was getting reloaded and we only changed 1 line of code in 1 class file. After a bit of research, we found out Eclipse just cleans the whole bin folder. Every class file was recompiled.
The reason why is still unknown. I couldn't figure this out. Anyways, it was really frustrating as the only solution to stop the reloading process, was to restart the application server. And if you have to restart the application server, why would you use JRebel?
The first thing I tried is stopping the "Automatic build" option in Eclipse. Disabling build automatically option does not break JRebel. JRebel depends on the results of the compilation, so if you disable the automatic build you will have to just compile the changed classes yourself, that's it.
But I didn't like that option either, so we found an option in JRebel which is actually a VM argument: -Drebel.check_class_hash=true which will check the checksum before reloading the classes. It may slow down the reloading time from a few milliseconds to some milliseconds extra. But it is still better than the situation when all the project classes have to be reloaded.
To summarize, this is my JRebel configuration in $JBOSS_HOME/bin/run.conf:
# JRebel JAVA_OPTS="$JAVA_OPTS -javaagent:$JREBEL_HOME/jrebel.jar -Drebel.log=false -Drebel.check_class_hash=true" JAVA_OPTS="$JAVA_OPTS -D##PRODUCT_NAME##.root=/Users/jochen/Documents/workspace/##PRODUCT_NAME##"