Reasons for switching to NetBeans

And a few thoughts on comparing NetBeans with Eclipse…

Download size: NetBeans = 58 MB, Eclipse = 103 MB [update 2006-04-19: Roumen says that NetBeans 6 on JDK 5 gets even better…]

NetBeans has built in Java EE support, most importantly the XML editing and JSP editing support. No more hunting for plugins. If you download the Eclipse WTP (Web Tools Platform) it is 180+ MB! wt?

The NetBeans profiler plugin (10 MB), you can actually drill down to method execution time and object memory usage. I use the Profiler in conjunction with JMeter and it is truly useful.

Pure Java. This is of course a major point of debate. I side with the Sun camp on this one : )

  • Write Once Run Anywhere matters. For example a lot of SWT porting effort would probably be needed when Windows Vista (finally) arrives. [update 2006-04-22: added this comment]
  • Swing is mature and getting faster and better. Mustang is looking quite good as it evolves.

Improved plug-in development / RCP model: Earlier one got the feeling that the plug-in model in NetBeans was an afterthought. But the NetBeans folks appear to have spent some time on this front and of late there have appeared some compelling tutorials on how to create NetBeans plugins or whole applications on the NetBeans rich client platform. Matisse is not a big deal for me, I don't do much Swing work. But knowing that I can design the GUI using Matisse, if I ever get down to writing a NetBeans plug-in feels right.

Ant used natively by NetBeans: A lot has been said on this especially the fact that you can run the generated script outside of the IDE, but I'm not too impressed with the auto-generated stuff. I prefer to write my own Ant script and be in total control :) NetBeans does support a "free form" mode for your custom Ant script, which works great even for Java EE web application projects. NetBeans allows you to call named targets in your Ant script and link them to menu actions such as build, clean, run etc. You can even fire ant targets specifically on files that you have selected in the package explorer window – for example I can run Checkstyle on only a single file on demand or run JUnit along with EMMA code coverage on a single file. Finally it is easy to add menu or toolbar button shortcuts to any of your Ant targets – I use this feature a lot.

Flexible project customization options: In addition to the Ant extensibility mentioned above, you can point your project definition file (nbproject/project.xml) to a properties file which can be even shared by say your custom ant script. I use this approach to control the build classpath within a single properties file and thus avoid updating my IDE project settings when library JARs have been added or upgraded. I hope to post more on how I integrated Maven 2 into my NetBeans environment soon…

27 Responses to Reasons for switching to NetBeans

  1. Pingback: The NetBeans reasons.

  2. What matters most is which tool are you productive in. Download and install, pure or not, profiler or not, plugins or not, once you get everything set up – which one do you get more work done in. This appears to vary from person to person.

  3. x says:

    Pure Java? Yeah right.

    – You distribute a .exe file for Windows, how’s that for platform independence? Why not have one file for all platforms?

    – You use AWT, which is not pure Java. Not much difference with SWT from that respect

  4. Andre says:

    > For example a lot of SWT porting effort would probably
    > be needed when > Windows Vista (finally) arrives.

    Huh? You don’t seem to understand enough of AWT/Swing/SWT.
    SWT uses native APIs so basically no porting necessary. This bug shows how it looks without any porting: https://bugs.eclipse.org/bugs/show_bug.cgi?id=78839.

  5. u says:

    Andre is right, it’s AWT (well, Swing) that has a handicap in the porting area, because they need to implement the widgets in Java and emulate the look and feel of the platform.

    Which, of course, is impossible and is never 100% right. See for example the Swing file dialog or set your Windows desktop to use single-clicks everywhere and see how your Swing applications will completely ignore it…

  6. Brad Reynolds says:

    The Eclipse download size that you’re talking about is the full SDK. This contains all source and developer documentation (as in using the Eclipse platform for developing applications rather than just as an IDE). Does the Netbeans distribution that you’re comparing it to contain the same type of content? Even though a non SDK Eclipse is a little more difficult to download it is much smaller than the numbers you have provided.

  7. JDLitwiller says:

    I keep trying to switch to Netbeans. Its XML/XSL editor is fabulous compared to the free plugins for Eclipse.

    But I’m simply too productive in Eclipse when doing Java work. The refactoring and auto-import/correction behavior of Eclipse is more intuitive and responsive.

    Netbeans innate use of Ant for building is great, but doesn’t seem very flexible — I seem to be “stuck” with what somebody at Netbeans decided was the “proper” way to layout a project.

  8. Abraham Tehrani says:

    It’s funny how the whole SWT vs Swing debate has become religious. I would like to remind people that SWT is really AWT version 2. Sun tried it already and we all know that AWT was not a scalable solution. So Sun dropped it and went a long with Swing. SWT arrives and now people are diving back into the same AWT problems people were having.

    Apparently people have not learned from their mistakes.

    Honestly, what compelling reasons are there not to use Swing? The one that is chanted often is “performance”. I well written Swing applications performance is negligable and in some cases not a factor. The other is the look and feel is not completely native. As someone mentioned single clicking in a Swing file dialog. There is no reason why one could go and extend Swing to incorporate these features. In fact the time and effort spent creating SWT is far more than putting that effort into improving Swing.

  9. Bruce Wong says:

    I am using both Eclipse and NetNeans.

    Maybe due to my VS.NET experience, I feel that NetBeans IDE and its functions are more consistent and easier to use and is less likely to crash (by other plug-ins, for example).

  10. Pingback: Digest bookmarks! » Daily Links

  11. Rafael Frantz says:

    When I want to setup a J2EE development environment at Eclipse, the time and the complexity to manage and install all the plugins you need, gets high, otherwise at NetBeans it is already done for you. If you need something differente you can customize it! Besides if you want to develop a desktop application it’s easier to do at NetBeans than at Eclipse. I use to work with Eclipse, but because of these and other reason explained at http://cld.blog-city.com/netbeans_and_eclipse_comparison__web_apps__no_contest.htm I diceded to move on… Of course the best thing is that we can choose what IDE we want to use ;-)

    Rafael Frantz.

  12. Robert Thornton says:

    > What matters most is which tool are you productive in.

    True, but only so long as the developer does not use that tool to introduce IDE dependencies into the source. A lot of developers in the early years of Java were more productive with Microsoft J++, but they also tended to introduce a lot of IDE (and JVM) incompatibilities into the source via Microsoft’s extensions. Users of J++ (like today’s Eclipse evangelists) had no reason to complain because they could always get it to compile and run. The rest of us were cursing under our breath because it was no longer the “write once, run anywhere” language we all loved. With NetBeans, even the project files and build scripts are IDE independent. The NetBeans commitment to this core Java philosophy is far more in line with that of the Java community as a whole than is Eclipse which far from encouraging unity, is promoting heterogeny. At my company, left to their own devices, developers used Eclipse in vastly different ways which led to project inconsistencies and lots of errors. The NetBeans approach is much more structured and less prone to chaos.

  13. Robert Thornton says:

    > Netbeans innate use of Ant for building is great, but doesn’t seem very
    > flexible — I seem to be “stuck” with what somebody at Netbeans
    > decided was the “proper” way to layout a project.

    I have to strongly disagree. I’ve written a lot of complex Ant scripts for specialized operations, and in the two years since NetBeans introduced its Ant project system, I have not yet found one thing that I cannot do with it. Project properties can be manipulated, extended and customized to support *any* project layout. Every target in the imported build script can be overridden to perform a custom build. There are nearly a dozen targets that are specifically designed to be overridden and these suffice for most needs.

    What’s also great about the NetBeans Ant project system is that it comes so packed full of power, and yet it is also designed to shield the developer from the complexity of Ant. I’ve never seen any build script, even custom scripts, that have nearly the level of flexibility and power that the NetBeans Ant scripts provide.

  14. Robert Thornton says:

    > You distribute a .exe file for Windows, how’s that for platform
    > independence? Why not have one file for all platforms?

    I’m sorry, but that’s just ignorant. Run NetBeans and open up your task manager. All of NetBeans is executed via the JVM. The .exe is a launcher, the same as with Eclipse, and it can be completely bypassed. The launcher simply does the work of setting up the classpath and JVM arguments, and it could just as easily be a shell script. NetBeans is truly platform independent. because it can be run on *any* platform that has a Java 1.4 compatible JVM.

    But also compare the NetBeans distribution to the Eclipse distribution. The NetBeans launcher is the *only* native binary within the IDE, and because it’s only used to launch the JVM, it is not essential to running the IDE. Eclipse, on the other hand, has its hooks into several native libraries and *cannot* be run without them.

    > You use AWT, which is not pure Java. Not much difference
    > with SWT from that respect

    No, there’s a big difference. If I distribute an application that runs on Swng/AWT, I only have to make one distribution and my customer knows that he can run it on his JVM. But if I distribute an application that runs on SWT, I either have to expect the customer to have the native SWT binaries installed on his machine, or I have to make a separate distribution for each platform that includes the native binaries. That kind of dependency only complicates a Java application and could ultimately hurt its marketability.

    The Swing model is increasingly using native APIs for much of its rendering and for its look-and-feel. With the Mustang release, this interaction is greater than ever. The difference between Sun’s approach and SWT, is that Sun retains a default look-and-feel for those systems that don’t have a native look-and-feel plugin installed. What can an SWT app revert to if a native look-and-feel is not supported. Oh, yeah, it can’t even execute….

  15. Kurt RIsser says:

    >> Ant used natively by NetBeans

    That’s great, but more and more folks are moving away from ant and using Maven. Although there is a Maven plug-in for NetBeans, it isn’t as full featured or mature as the Maven plug-in for Eclipse. I hope that this changes soon.
    Of course, NetBeans is still my preferred IDE, Maven or not!

  16. Peter Thomas says:

    >> That’s great, but more and more folks are moving away from ant and using Maven

    At the moment I feel that completely replacing Ant like what the Maven guys advocate is not the right thing to do. Ant still has its strengths and well, almost everyone uses it…

    I agree that the Maven plug-in for NetBeans needs to improve and maybe someday soon would measure up. At the moment I feel that Maven should be used just for dependency management and Ant can do the rest of the normal build stuff. The main thing I lose with Maven at the moment is being able to hook into my Ant targets within NetBeans. There are a few other things I will post about later.

  17. Vivek says:

    Hi,

    Bottom line, I have been using various IDE’s for the last few years, I tried my hands as netbeans as well, but I feel I am just not as productive in a netbeans enviroment as compared to eclipse. I feel eclipse enviroment is far too intutive and works just the way you want it to work. For me and lot of my peers that I know, Netbeans has still not got there. I mean working in an enviroment and then going on a feature hunt, in my opinion is just plain un-comfortable. That’s my opinion.

    Thanks.

  18. Pingback: Incremental Operations » Another way to Integrate Maven 2 with Ant (and NetBeans)

  19. milos kleint says:

    >>> Ant used natively by NetBeans
    >
    >That’s great, but more and more folks are moving away from ant and >using Maven. Although there is a Maven plug-in for NetBeans, it isn’t >as full featured or mature as the Maven plug-in for Eclipse. I hope that >this changes soon.
    >Of course, NetBeans is still my preferred IDE, Maven or not!

    could you please elaborate on the areas where the eclipse plugin is better than the netbeans maven integration? Are you talking maven1 or maven2? have you tried the mevenide Netbeans module or the command line tool that generates the ant freeform project?

  20. Tom says:

    But when I want to _program Java_ (weird thing), Eclipse is better.

    And Ant integrated into the IDE build (or Maven for that matter) is lame and slow.

    That said, I’d love to see Eclipse get smaller and also better at general purpose text editing.

  21. Peter Thomas says:

    >> Huh? You don’t seem to understand enough of AWT/Swing/SWT.
    >> SWT uses native APIs so basically no porting necessary. This bug shows
    >> how it looks without any porting: https://bugs.eclipse.org/bugs/show_bug.cgi?id=78839

    I have to admit that Mac OSX may have made a better example. However refer this other Eclipse bug related to Vista: Address new window system capabilities. The point I was trying to make anyway is the old Swing vs SWT debate and I think commenters on this blog entry have addressed that to some extent. This is very much a religious war and knowing how painful this can get – having engaged in an e-mail (flame) war with friends on this topic, I’ll shut up and move on. For those looking for more information, I can point to a good debate at this blog entry here: Swing and SWT on Windows Vista – and do read the comments there as well.

    Other recommended links for further reading:

    IBM article: SWT, Swing or AWT: Which is right for you?

    Hacknot: SWT so What?

    CLD: Why Eclipse Developers Are Moving To NetBeans

    DamnHandy: Why bother with SWT over Swing?

    Chet Haase: Mustang, Swing, and NetBeans on Windows Vista: Looking Good!

  22. Neil says:

    All this FUD about “hunting for plugins” and ridiculous download sizes is really out of date. Here’s the current download process:

    1) Download the Eclipse Platform drop (34 Mb)
    2) From the welcome screen, open the Update Manager
    3) Select the tools that you actually want and need, here’s the current menu:
    – Java development (that’s right, it’s not compulsory. Lots of Eclipse users are using it for developing in C or C++ or Ruby or Python or PHP, etc)
    – Plugin development
    – Web Tools (including a great XML editor and graphical Schema designer that betters commercial offerings like XML Spy)
    – Business Intelligence and Reporting Tools
    – Database development tools
    – C and C++ development
    – Visual Editor for drag and drop GUI design
    – Test and performance tools (including profiler)
    – J2EE tools

    As for the comments about SWT versus Swing – really not worth raking this over yet again, but here as well there is a lot of FUD against SWT. It’s not “pure Java” because it contains native code… well guess what, so does AWT, and Swing is built on AWT.

    Native support for ANT? Eclipse has that as well, although if ANT is supposed to be the “standard” way of building Java, can anybody tell me which JSR establishes this?

  23. Pingback: Incremental Operations » Eclipse porting bug open since 2004

  24. idehound says:

    Simply put SWT has lost any edge it had. It is the albatross of eclipse and its RCP. IBM puts a lot of money and effort into making SWT work on lots of platforms. That money and effort could be spent on the IDE. Why not just focus on 1 JDK and make it work . . . .
    Competition is good for both IDE camps from a feature perspective not a operating system integration layer. Your desire/requirement will win the day. We are doing JavaEE 5 on a number of platforms … Eclipse is plain dreadful in many aspects of Enterprise development and integration out of the box and is behind a lot of JSR specifications. Momentum of an IDE doesn’t make it the best, makes it and IDE with momentum for whatever the reason. Doesn’t meet your current requirement, don’t use it. We don’t.

  25. I just wanted to mention, that I have been able to run Netbeans 5.0 on my SGI Origin workstation under Irix, using an old and beta JRE 1.4.1.

    Platform independence? Yes Sir!

    Personally I still prefer Eclipse, but that may be only because I’m used to it. At first Netbeans is only different, without judgement. There are a lot of quality plugins on both sides, you just have to finde them, shortcuts are different and several things are solved differently – such as JavaDoc…

    I’m open to new stuff and as a “desktop guy” I’ll keep an eye on Netbeans because of Matisse. But I’m also impressed by all the great tutorials and screencasts regarding plugins and the Netbeans Platform.

  26. McPaint says:

    Why fihging, everybody knows the gratest IDE ever is Visual Studio :P

  27. Pingback: Never install NetBeans again « Incremental Operations

%d bloggers like this: