Ask HN: What is the best Java IDE?
I've been using Java for several years, but have never really yet felt the need for an IDE. I've toyed with Eclipse a bit, but for the most part my projects have been small enough that I've just done them in vim.
At work I've begun using Java much more heavily, and have been introduced to IntelliJ IDEA. I really like it so far, and it's making me wonder how I ever made do without the awesome code completion and refactoring features of a great Java IDE.
I've had a hard time finding a really good comparison of recent versions of the major IDEs (Eclipse, NetBeans and IntelliJ), so for those of you who have used a few different Java IDEs (or even those who have only used one), what are your favourite features, or the things you most missed when you switched IDEs. Which one would you recommend to someone new to the world of Java IDEs who hasn't yet developed too strong an allegiance?
(
25 comments
| 20 points
| on HN
)
The language integration is much richer - and it has a more solid foundation for working with multiple languages. For example, find usages and refactor-rename will work across different languages and templates. When I find usages for a field, for instance, it shows me where it is used in hibernate queries, EL expressions on pages, etc.
Languages can be arbitrarily nested in each other, a lot more so than other IDEs I've used - for instance, I can still use command completion and refactoring in nested SQL, HTML, CSS or even Javascript (eg. GWT's JSNI methods) when it is inside java strings, or XML documents, or wherever else.
The JavaScript support far exceeds either Eclipse or Netbeans. IntelliJ has fairly decent refactoring and completion for Javascript, which the other IDEs (at least as of last year) barely supported.
It has full completion, find usages, and jump-to-usage within JPA/Hibernate queries, which all ties straight back to the original entity classes.
The refactoring tools are a lot richer, and a lot faster than Eclipse or netbeans offered. On a largish project the refactoring commands still feel near-instant in IntelliJ -- it may not sound like such a big deal, but after becoming accustomed to it, I use the refactoring tools constantly while writing code. I didn't do it nearly as much with the other IDEs.
The refactoring commands are all extremely solid -- for instance, the extract method refactoring will detect similar code snippets and ask you if you want to replace them with the method call. I never had Eclipse or Netbeans ask me that (Have they changed in the newer versions?)
I've also found the support for Git far exceeds the other IDEs.
While the price seems expensive compared to the free competition, most programmers use their IDE 8 hours per day -- given programmer wages, it only takes a tiny improvement in productivity to pay for itself.
The big feature of NetBeans is simply that it's fully-integrated. Out of the box, it works with Maven, Subversion, Mercurial, etc. Comes with Tomcat and HSQL so you can deploy your web apps from within the IDE. It requires far less setup and just generally "does the right thing" without really requiring me to make a bunch of decisions and install a ton of plugins. With Eclipse I never managed to make any of that stuff work; there are many different plugins you'll find for any given task by searching, and many of them have plugin dependencies or are outdated or just suck. My time is too valuable to spend it making Eclipse into the one IDE to rule them all. I have not been disappointed by NetBeans, and three of my coworkers have switched to it since I've been there, I suspect because they got tired of configuring Eclipse.
Just my two cents. I'm sure a lot of what I gripe about is "easy" to do, and I certainly would admit that more is possible with Eclipse, but the tradeoff just doesn't seem worth it to me.
I have used IntelliJ and I far prefer Netbeans from 6.7 on. I suspect a lot of people used an older version of Netbeans but after 6.7 it is probably the most well integrated IDE available for Java as well as an assortment of other languages.
Someone said the Javascript support was better in IntelliJ product and I just don't see that, Netbeans has better support for Javascript than ever Aptana Studio as well it supports the syntax of all of the major JS Toolkits from Dojo to jQuery.
Netbeans rivals Visual Studio when it comes to an well integrated environment that provides UI's for SQL / DB managment, HTML, CSS, XML, JSON, Server managment and is the first IDE that I did not feel like I was roughing it in since coming back to Java from doing some .NET work for a couple of years.
On a bit of a tangent: If you are editing many different types of text (In my case: HTML/Templates, Sass/CSS, Javascript, Python, config files, a little bit of Java/Scala, etc.) then go completely IDE-free and learn Vim or Emacs. For me, the IDE vs Text Editor debate comes down to the question "Am I primarily editing one type of code in a single strongly typed language, or am I primarily edited text?"
If you install the Ruby plugin (also built by JetBrains, for their Ruby IDE) you get support for Sass - and they've just announced support for Less and Sass3 in the next version, including command completion and jump-to-declaration. http://blogs.jetbrains.com/ruby/2010/07/whats-mining-leaner-...
The Scala plugin doesn't seem too bad either, but I haven't used it extensively. It already has some simple refactoring features.
They're also working on a Python IDE, which is in beta, so the Python plugin will get fairly good too.
On the downside, Eclipse is awfully memory hungry in my experience. Not sure how it compares to Netbeans or IntelliJ though.
I thought it might be because I've had at least 4gb of RAM in every computer I've used for several years now, but when I checked its memory usage eclipse was using around 250mb.
I've asked a friend who uses a netbook with 1gb of ram and he uses eclipse without issue on a regular basis as well, so I'm really not sure where this myth comes from.
Maybe people are just loading up their eclipses with a ton of plugins?
I use Netbeans for Rails, but I've never really gotten into using it for Java. Although, I hear their Swing WYSIWYG editor is nice.
I've never used IDEA, but I've never read one negative thing about it. In fact, I've also get the impression that a lot of developers swear by it. I just don't want to pay for it.
http://www.jetbrains.com/idea/free_java_ide.html
If you're interested, the comparison is at http://www.datafaber.com/post/view/id/521 .
I find IntelliJ's support for Scala and Clojure to also be good. I built the open source version from source, and kicked its tires also: worked with the Clojure and Scala plugins but does not support much J2EE stuff - you might want to give that a try.
As already mentioned, besides other things, IDEA's refactoring is super solid. The ease with which one can perform such functions using IDEA actually supports their tagline - "... develop with pleasure!"
It's SVN integration is also good.
I'm currently learning with Notepad so I can force the syntax on myself. Is this a bad idea for a newb? I have Notepad++ but I haven't fired it up for Java yet, I just like it because I'm used to Geany on my linux machines and it feels similar.
So really, would you prefer to get red squiggly lines to show you your errors as you type, or would you rather try to get it perfect first before having to run a command-line program for compilation?
On the other hand, spell check made my spelling take a dive, so I had to consciously decide to stop using the right-click and replace-- hmm.
A few years ago, IDEA was even more the-best than now, because the gap with Eclipse was wider. Nowadays Eclipse probably has most of the functionality, but there's still the difference that usually exists between open-source and commercial software. The commercial software tends to be better to use.