Thursday, May 14, 2009

JavaRebel + m2eclipse = Sweet Spot

One of the pain-points while developing Java-based web-applications is the issue of the bouncing server. Every time you change a class file, your web application context needs a restart. While this is mildly annoying for small applications, it is simply unbearable for anything more substantial.

As far as I now the best and cheapest solution so far has been to use MyEclipse. It worked great and I rarely had to restart web contexts.

I always wondered why the standard IDEs (E.g. plain Eclipse WTP, IntelliJ ) never solved that re-deployment issue. Well, at least I have not been able to get this sufficiently working in plain Eclipse+WTP or IDEA IntelliJ.

Unfortunately, with the advent of Maven, MyEclipse started to loose come of its charm. For years, they were not able to provide an acceptable Maven integration (There was an entry on their forum for years demanding that feature) and on the other side, WTP started to become usable (I have not really tested the Maven integration introduced with MyEclipse 7 but I have read, that it is still not perfect). But one thing, that MyEclipse had nonetheless going for it, were its hot deployment capabilities.

Enter ZeroTurnaround's JavaRebel. Four weeks ago I started looking at JavaRebel and have been using it for the development of my OSS project since then. My verdict: It is awesome.

I use it in conjunction with the m2eclipse plugin and it simply works. ZeroTurnaround provides guides regarding the Eclipse and Maven integration (here and here) that are fairly straigtforward. It also comes with support for Spring and Struts2 directly.

The nice thing about JavaRebel is that it is agnostic to the used IDE as it simply hooks into the JVM as a Java agent. Therefore, you probably could also easily use it from the command line (in case you like to code using VI :-).

One drawback is the price which makes JavaRebel more expensive than MyEclipse. On the other hand, there is not much in MyEclipse that you cannot have in plain Eclipse/WTP using free plugins. Thus, ultimately it may boil down to personal preference but to me JavaRebel with plain Eclipse WTP (or IntelliJ for that matter) is the much nicer package. And if you have a project with an OSS license you can get JavaRebel for free, and don't have to buy MyEclipse.


jeckels said...


Good post. I will have to take issue with your comment on getting most of MyEclipse by using Eclipse + free plugins.

A good portion of MyEclipse is not only integration technology (which you will not get with the free stuff), but also proprietary of MyEclipse-only solutions.

Spring/Hibernate integration
Swing GUI designer
Advanced Visual editing
World's best RESTful Web Service tool suite
Advanced reporting solutions
JavaScript Debugging
Ajax Tooling
Intense database tools and support
And, as you mention, the hot-sync deployment.
The list goes on...

While not all of these are valuable to every single developer, I would hardly say that you can get "most" of MyEclipse for free. There's a reason MyEclipse has 300,000 man-hours in development.

Thanks again for the post. All the best!


Rajesh said...

There is a free social version of Jrebel now.