3

We are using JRebel to quickly reload Java code changes into our JVM. This is working great!

But, we are also using Eclipse as IDE. And for some reason, Eclipse can really rebuild the whole project in my workspace, just because I add an annotation, I remove a method, or any other little code change ... Because of this rebuild phase, all classes are regenerated and are required to be reloaded by JRebel.

Is there any way to debug why Eclipse is always rebuilding our project for even a stupid little code change? I'm using Eclipse Indigo.

Thanks, Jochen

Jochen Hebbrecht
  • 733
  • 2
  • 9
  • 23

2 Answers2

5

You need to disable (or) uncheck Build Automatically.

Goto Project menu--->uncheck Build Automatically.

NOTE: This disables Automatic build. But as JesperE commented, it may impact the cause why you JRebel.

kosa
  • 65,990
  • 13
  • 130
  • 167
  • To be frank, I never used JRebel. But, JesperE comment may worth to validate before deciding on disabling "Build Autimatically". – kosa Nov 14 '12 at 15:26
  • ... I'm sure this option breaks JRebel :-). I talked with the guys of JRebel at #devoxx – Jochen Hebbrecht Nov 14 '12 at 15:41
  • @JochenHebbrecht: Good to know. So, the answer would be you have to liveup with auto build if you want JRebel working. Otherwise you may disable auto build as I said in my answer. – kosa Nov 14 '12 at 15:44
  • No, the guys of JRebel say it's not normal Eclipse rebuilds the whole project for just the removal of a method. There's something wrong with Eclipse or/and a plugin which is installed in my Eclipse. So I need to find out what's going wrong. – Jochen Hebbrecht Nov 14 '12 at 15:45
  • @JochenHebbrecht 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. (i'm from JRebel team) – Anton Arhipov Nov 14 '12 at 19:17
  • alternatively, you can try setting 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 – Anton Arhipov Nov 14 '12 at 19:39
  • @AntonArhipov: it's working !!! :-). Can you add your comment as an answer so I can accept the correct answer? Thanks! – Jochen Hebbrecht Nov 15 '12 at 09:52
3

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.

You can try setting 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.

Anton Arhipov
  • 6,479
  • 1
  • 35
  • 43