GWT IDE Selection
I’m starting a new GWT project at work, so I wanted to select the best IDE for the job. I installed the very latest versions of these IDEs along with their respective GWT plugins:
- Eclipse 3.5 (Galileo)
- NetBeans 6.7
- IDEA 8.1
I’ll warn you right now that this is not an in-depth review or comparison. I looked just deep enough to satisfy my own curiosity and to choose a tool for my own coding.
Eclipse
Eclipse has an advantage in that Google supplies the Google Plugin for Eclipse, ensuring the plugin generates the exact same directory layout as the GWT command line tools. After installing Eclipse and the plugin, I generated a sample GWT project and it ran perfectly in hosted mode.
This is where things went badly, however. As you may know, GWT services consist of two interfaces and a class:
- MyService
- MyServiceAsync
- MyServiceImpl
For my first (and only) trick, I performed a Rename refactoring on MyService. Eclipse renamed that interface, but not the other interface or implementation class. Instead, Eclipse immediately lit up with errors, forcing me to manually rename the Async interface and Impl class. Epic fail.
NetBeans
NetBeans also supports GWT through the gwt4nb plugin. I generated a project and noted it creates a slightly different directory layout, but nothing that would introduce problems.
Like Eclipse, NetBeans failed the Rename refactoring test. Unlike Eclipse, however, NetBeans did not immediately indicate errors in the mismatched class and interface names. Thus, errors would only manifest later at runtime. I gave up very quickly.
IDEA
Unlike the other two IDEs, IDEA’s plugin does not yet support the new directory layout introduced in GWT 1.6. I initially assumed this would be a big problem, since you also see deprecation warnings when you launch your app in hosted mode.
In reality, however, the directory layout differences only manifest themselves in the output directories. The source directories are the same, so a simple Ant buildfile can produce a more standard GWT 1.7 WAR-style layout.
Of the three IDEs, IDEA is the only one to properly implement the Rename refactoring. When you rename your Service interface, the other interface and class both rename in unison.
Also, IDEA does a kick-ass job of keeping CSS styles in sync with styles referenced in GWT code. As I discovered today, when I define a style name in Java code, IDEA shows it in red and can automatically insert a new style class into my CSS file. I also refactored a <div> identifier in my HTML file, and IDEA correctly refactored the String reference in the Java source code!
Conclusion
I’ve used IDEA for years, and was initially put off by the fact that IDEA 8.1 does not yet fully support the new GWT 1.6 and 1.7 directory layout. In practice, this is a non-issue, and IDEA 9 will support the latest GWT conventions. IDEA’s first rate refactoring, along with tight integration with CSS classes and HTML identifiers really set it apart from the other IDEs.
I’m glad (and agree that) IDEA continues to rule in the “correctness” dimension. I just wish JetBrains would do a “Snow Leopard”-like release concentrating on speed and stability, rather than features. Version 8.x has been such a loser for us WRT those dimensions, I’m a little concerned about 9.x.
IDEA does sound like it’s pretty clearly in the lead. But I feel like maybe you applied the “Epic fail” brand to the wrong runner-up. Eclipse failed to perform the rename properly, but you at least got some notification. If NetBeans truly wasn’t going to tell you until _runtime_, that failure is truly epic.
Thanks Eric, keep us updated on your experiences with GWT and IDEA.
I think you’re being a little too hard on Eclipse. I think it’s an outstanding Java IDE and have used it on Windows/Linux/Mac platforms. The Google plugins make it an even more compelling if you’re doing GWT or Google App work. (I even use Eclipse for C/C++)
I just replicated your example, and Eclipse does update the interface name in the MyServiceImpl class definition when you refactor it. It doesn’t change the MyServiceImpl classname since it wouldn’t know to do so (and that name doesn’t need to be changed).
You are correct about Eclipse not changing the MyServiceAsync, however keep in mind that this is a GWT plugin error, not a Java error. Apparently Eclipse is not smart enough to refactor according to the rules of plugins, just Java rules. So I think that’s a very minor complaint.
That said, I’ve never used IDEA so I’ll give that a try and see how it compares.
I was going to check out IDEA (currently using Eclipse) but then I noticed something that puts a shift in Eclipse’s favor. Eclipse is free, when I saw that IDEA was a paid for program and only complaint is a very small one Eclipse turns out better for me. Of course if you already have IDEA or if you’re making an open source project then IDEA is worth checking out. But I think google themselves develop using Eclipse with gwt
@Chris Google employees are free to use whatever IDEs they prefer. I have friends who work at Google and they use IDEA. Don’t assume all of Google uses Eclipse just because they have a handful of developers maintaining an Eclipse plugin.
We all realize Eclipse is free.
We have been using gwt for almost two years and started with IDEA but as GWT advanced faster than JetBrains we switched to Eclipse and are satisfied and see no reason to switch back even though we have IDEA licenses.
Eric,
We hear you on the RPC refactoring support in the Google Plugin for Eclipse. We added RPC validation and quick fixes in the last release of the plugin (v1.1), but refactoring didn’t make the code freeze. Keep an eye out for RPC refactoring support in the next release.
Andrew
You evaluation GWT IDE’s shouldn’t be based entirely on GWT support. The primary reason I picked Google Plugin for Eclipse was because it’s an Eclipse plugin. I have a bunch of other plugins in Eclipse to support my GWT development, including Spring, JPA, and DWR. Even if the Google plugin isn’t perfect, I won’t switch IDEs.
@Niel thanks for telling me what I shouldn’t do. As I stated very clearly:
“I looked just deep enough to satisfy my own curiosity and to choose a tool for my own coding.”
@Eric FYI…I wasn’t criticizing. Sorry if it was taken that way. You blog post kicked off an interesting discussion, and I was just adding my $.02.
I’m currently using IDEA 8.1 (customer’s choice, not mine). I found a problem with the way it handles the sync between the service interface and the async interface: it insists on having methods in the async interface return void, while this is in no way required by GWT. Methods in the async interface can return anything you like, and it can be pretty handy sometimes (we use this in this project to return a RequestBuilder). IDEA generates a bunch of warnings “asynchronous remote service doesn’t define corresponding method”, which is not correct. Also, the only fix that is offered for this warning is “synchronize all methods”, which effectively recreates the async interface… with all methods returning void! So we can’t rely on IDEA to maintain the sync.
@Eric, finally a good discussion about different IDEs that didn’t turn into a full blown mud-slinging, “My IDE’s dad can beat up your IDE’s dad,” Waste of time. Perhaps I should congratulate your posters as well. This is good stuff, thanks!
I have done the same like you Eric, but i am not sure which IDE is the best for working with GWT. For Project generation i recommend to use the gwt-batch-file, after that the generated eclipse project can be imported into Eclipse, NetBeans or IDEA.
NetBeans and IDEA are having massive problems generating a correct GWT-Project. At IDEA there is the build-file missing and NetBeans produce a build-file with its own target-structure (could be confusing for GWT-Beginners). Some other points where the IDE’s are similar, are the code inspections and support for editing and creating GWT relevant files.
If you have a simple GWT-Project i would recommend Eclipse, for more complex GWT apps – using Spring, Hibernate … – i would recommend IDEA (good refactoring, inspections..) or if you don’t want to pay money – take a lookt at NetBeans.
@Siegfried Why wouldn’t you recommend eclipse for more complex GWT apps?
I’m looking for an IDE with as few as possible issues to integrate with GWT. I think Eclipse is the best choice. NetBeans is great but the directory structure is not match with GWT, so it’s out. I didn’t test IDEA ever, but it seems hasn’t full support of GWT (according to other comments).
The thing is just annoying me a bit, is that some folks noted they using Eclipse for simple projects. I don’t know why, but I think that’s a personal reason, not a technical one.
Instantiations GWT Designer for Eclipse does these renames properly. Its seriously great in my book, highly recommended.
i love netbeans, and i like eclipse, both is perfect