Jakub is a Java EE developer since 2005 and occasionally a project manager, working currently with Iterate AS. He's highly interested in developer productivity (and tools like Maven and AOP/AspectJ), web frameworks, Java portals, testing and performance and works a lot with IBM technologies. A native to Czech Republic, he lives now in Oslo, Norway. Jakub is a DZone MVB and is not an employee of DZone and has posted 155 posts at DZone. You can read more from them at their website. View Full User Profile

Comparison of Eclipse 3.6 and IntelliJ IDEA 10.5: Pros and Cons

10.25.2011
| 28099 views |
  • submit to reddit

After having worked with Eclipse for over 5 years I’ve came to use IntelliJ IDEA intensively on a J2EE project in three months and took this as an opportunity to compare the two. You can’t really compare 5 years and 3 months but I still believe that it is long enough to get a pretty good overview of what a tool is like.

For the impatient:

IntelliJ is a very good tool, its killing feature for me is its excellent support for other languages such as Groovy (e.g. for unit tests) and Clojure. Many details are more worked-out and with a higher usability then in Eclipse, f.ex. search & replace with match highlighting and replacement preview. Its support for navigability and refactoring across multiple languages (Java, JSP, JSF, HQL, Spring config in my case) is also an absolutely great feature for productivity. And of course I have to add it credits for being a Czech product [1] (interestingly enough, NetBeans also comes from the Czech Republic [2]; it’s a pity Eclipse hasn’t this link too) :-) .

My main issue with IntelliJ is its performance. First, running tests is slow because IntelliJ only does (re)compile the test/source when you hit the run button as opposed to Eclipse’ incremental compilation. And that makes TDD very painful. (I tried to use the old Eclipse Mode plugin but it has problems with IntelliJ 9/10.) Second, sometimes the UI freezes and you have to wait seconds or tens of seconds for it to respond again (even after disabling most plugins and some analysis). It doesn’t happen too often but often enough to be noticed, to be annoying, and to interrupt the development flow.

So I guess I’ll use either Eclipse or IntelliJ with respect to the needs of the project at hand and hope for IntelliJ to resolve its performance issues (as NetBeans did).

What’s Cool in IntelliJ IDEA

The things I’ve stumbled upon and considered them noteworthy (there are certainly more of such goodies):

  • Great support for Groovy and Clojure (and others). I’ve used Groovy to write unit tests for my Java project and it worked pretty well (only click + Alt+Enter on a non-existing method to  create it didn’t work unless the target class was a nested (static) class in the test itself)
  • Out-of-the-box support for Spring*, namely you can click a bean class name in the applicationContext.xml to jump to it, deprecated classes are struck out, bean definitions are validated against available constructors and setters
  • Refactoring
    • Move can move more members/methods at once
    • Move method is aware of the current class’ field of the target type so it is able to automatically insert fieldOfTargetType.movedMethod() – st- I miss a lot in Eclipse
    • Rename takes care also of JSF EL expressions in JSPs and other non-Java references (I suppose it is more clever than just a simple text search & replace)
  • Completion proposals are displayed as you type (without pressing a hotkey – I love that) AND they include types that haven’t been imported yet (@BeforeClass in a test…)
  • (Auto)Completion proposals over multiple languages
    • CSS classes in JSPs (and in CSS/style it proposes e.g. color names)
  • Click-through in JSF EL expressions (well, at least sometimes)
  • Usage search can find also method usages in JSPs, Spring config etc.
  • Debugging
    • The Variables window automatically shows not only the local variables but also expressions based on them that are used in the code such as “array_variable.length”- a good time saver
  • JavaDoc: Closing tag completion – I’ve always missed that so much in Eclipse!
  • When you generate a foreach loop (“itco” + tab) and change the source collection then it updates the element type automatically (in “for (Type t: sourceColl)”)
  • Really helpful RegExp integration in find & replace in file – when typing, it shows both the first matched expression and what it will be replaced with
  • General: Good at guessing resonable names for variables, …
  • Possibility to define a module for a subdirectory of the main module => you may have a project using Java 1.4 with tests in Java 5+. Works great with Maven multi-module projects too.
  • The Project view displays directly Java types so you can distinguish a class from an interface at the first glance (Eclipse shows a file icon and you need to expand it first)
  • The Java file structure view can show a “property” instead of a getter and a setter, making it shortet and easier to find what’s really important

*) The Ultimate edition only (likely)

I’d recommend reading also the responses to the StackOverflow question Things possible in IntelliJ that aren’t possible in Eclipse? – among others they mention click-through anything, autocomplete taking into account more of the context (e.g. the name of the variable), the rename method refactoring updating also JSPs, Spring config, etc..

In general I’d say that IntelliJ has strong focus on usability and productivity, tries to understand what developers usually do and need and helps them with that and is pretty good at it. The authors claim it to be “The Most Intelligent Java IDE” and I think they do not exaggerate (or at least not too much :-) ).

Not So Cool

(In no particular order.)

  • Eclipse only needs two hotkeys: Completion (^space) for class/property/templates/surround-with and Quick Fix (^1 – the most powerful tool in E.) for fixes such as imports, refactorings etc. In II you’ve several hotkeys for completion, one for live templates, one for fixes (intentions) … – I’ve never managed to remember them all and to decide which one I should use in a particular situation
  • No JavaDoc popup on mouse over (need ^J)
  • The Live Template editor sucks, at least under Mac (can’t type end-of-line, a curly bracket on Norwegian keyboard with Alt+Shift+8, backspace, …). Fortunately you can select a code in an editor and Tools | Save as Live Template (though you should likely un-indent it first)
  • No favorite static imports – for the first static method of a particular class I have to: 1) write the start of the method name; 2) press Ctrl+Alt+Space (Class name completion, don’t ask me why this); 3) select the desired method such as CoreMatchers.allOf and press Alt+Enter as suggested in the pop-up’s “status bar” -> select Import statically. Since that on, all the static methods of the class will appear in the normal Ctrl+Space completion list (that’s nice, though). In Eclipse I can add my belowed JUnit/Hamcrest/Mockito friends to favorite imports and have them always available.
  • Slowness
    • Slow testing – changed files are compiled just before a test is run while in Eclipse they have been compiled as soon as they were saved
    • Sometimes II freezes for seconds/10s of seconds :’(
    • Running analysis is SLOW (Checkstyle, …) and can kill your IDE (and you too if you’re of a weaker heart)
  • The UI is little buggy, at least on Mac – dialogs not hidden when you click on another menu – not a big issue but annoying anyway
  • Running webapp on Tomcat works great for some colleagues but not all  – useless logging without any details, the server doesn’t start, no hints for how to solve, the Server -> Output window contains confusing “Disconnected from server”, Tomcat Log window contains only INFO logs (where are my debug logs?!), the file logs/catalina.out doesn’t exist anymore, Tomcat failure visible in browser yet nothing in the logs …
  • JavaDoc – ‘#method’ + ^space in Eclipse generates {@link #method} automatically, not so in II; even worse, class lookup doesn’t work at all in II w/ot typing a @link first. I’ve found a workaround via a live template but I have to type its name and invoke it manually anyway.
  • I miss Eclipse’ auto-dissapearing views (just click anywhere in the editor and they’ll disappear – though in II you can use shift+Esc) and the ability to maximize any view with double-click
  • The number of plugins for IntelliJ is smaller than for Eclipse though all the main projects likely target it too

I could perhaps live with the small annoyances (or may be learn the proper way to do what I’m trying to achieve?) but the performance issues are hard to accept.

Useful Resources

Conclusion

Read the first 4 paragraphs again :-)

The Software Compared

  • Eclipse 3.6 – I’ve worked with Eclipse since 3.0 or may be even before on many commercial projects
  • IntelliJ IDEA Ultimate (the commercial, full-featured edition; II community is good enough unless you need special support for frameworks like JavaEE, Spring, and Hibernate – see the editions comparison)

 

From http://theholyjava.wordpress.com/2011/10/18/comparison-of-eclipse-3-6-and-intellij-idea-10-5-pros-and-cons/

Published at DZone with permission of Jakub Holý, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Yann Cébron replied on Tue, 2011/10/25 - 4:25am

Thanks for this nice write-up, I mostly agree with your statements but some "Not So Cool" points could need some clarification:

"Eclipse only needs two hotkeys" - well I guess that's (mostly) a matter of getting used to it (and personal preferences).

"Slow testing" is a bit misleading when it's just the compiler that is invoked explicitly before running the tests (Eclipse is not faster compiling your code ;-)).

"Running analysis is SLOW" - what analysis exactly, builtin inspections or 3rd-party plugins like Checkstyle integration? 

For UI/Mac issues I'd suggest to try upcoming IDEA 11 (currently in Early Access) which provides a much more pleasant integration.

Yes, the number of plugins is smaller than for Eclipse, but from my experience the quality and integration with the IDE is in general much better.

W/r to performance issues, please try the solutions in http://devnet.jetbrains.net/docs/DOC-192

Cheers,

 Yann

Kai Wähner replied on Tue, 2011/10/25 - 5:45am

I (have to) use Eclipse in almost every real project, no matter which customer. I use IntelliJ IDEA when evaluating new stuff and playing around. I think the most important issue of IntelliJ IDEA is its bad performance. It is really slow on my MacBook Pro and the missing update of the Eclipse Mode plugin for IntelliJ IDEA 10 sometimes makes me crazy.

I would not recommend IntelliJ IDEA for real world projects until this issue is fixed. Besides this complaint, I think the pros outperform the cons a lot...

 

Best regards,

Kai Wähner (Twitter: @KaiWaehner)

Roger Studner replied on Tue, 2011/10/25 - 7:25am in response to: Kai Wähner

I have used intellij on a MBP for 4+ years and found it far more performant and useful than Eclipse (could ever be)

 

 

Jakub Holý replied on Tue, 2011/10/25 - 8:14am in response to: Yann Cébron

@Yann - thanks for commenting

 > "Eclipse only needs two hotkeys"

I agree that it might be just a matter of getting used to it (which I haven't managed in 3 months - but perhaps i haven't tried hard enough). So this "disadvantage" only applies to experienced Eclipsers.

 > "Slow testing"

Here I do not agree. What is important is not what the IDE is doing or not doing but how quickly I can get my feedback. In Eclipse the time it gets to get feedback from tests is determined only by the time to run them (because Eclipse has already compiled everything for me). In II I have to WAIT for the compilation and those seconds add up pretty much with the constant modify/test cycle of TDD. So testing in II is slow for a user - no matter why.

 > "Running analysis is SLOW"

 3rd-party, namely Checkstyle. Again in Eclipse - and I don't really care why - I got feedback from Checkstyle w/o any visible performance penalty while in II I basically had to disable it, which kind of diminishes its benefits.

Yann Cébron replied on Tue, 2011/10/25 - 9:35am in response to: Jakub Holý

Hello Jakub,

thanks for your reply.

The point about continuous compilation is of course valid and somewhat disturbing. Please bear in mind this point is only valid for simple projects (compilable by IDE) not relying on Ant, Maven or whatever build-tool required to be run before tests.

There seem to be several Checkstyle plugins available, maybe another one works better?

Cheers,

 Yann

Dan Howard replied on Tue, 2011/10/25 - 10:26am

I think by default IntelliJ assigns 64 meg of ram for Java but you can bump this up. Look for a file idea.exe.vmoptions in bin folder (might vary by platform).

 I use:

-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-ea

 and my performance is good even with my 10000 file Java project.

Endre Varga replied on Tue, 2011/10/25 - 1:26pm

I was using Eclipse for 4-5 years when I changed to IntelliJ half year ago. I dunno about Mac, but on Windows IntelliJ beats Eclipse's performance by a _huge_ margin. I just cannot go back to Eclipse without a lot of swearing now. As for the code completion hotkeys, they were very confusing for me as well, but trust me, it is just a matter of getting used to.

Martijn Stellinga replied on Wed, 2011/10/26 - 5:58am

Hello Jekub,

Great analysis.

About the performance: IDEA version 10.5.2 has a couple of fixes for freezes (http://confluence.jetbrains.net/display/IDEADEV/IntelliJ+IDEA+10.5.2+Release+Notes), which might address some of your problems.

 

Regards,

Martijn

Ed Staub replied on Wed, 2011/10/26 - 7:51am

Two suggestions for improving Intellij (and Eclipse) performance:

1.) Disable plugins you aren't using.

2.) If you are not modifying a lot of "modules" ("projects" in Eclipse), but need access to the source when debugging and to navigate into to look up details,  include them in the project ("workspace" in Eclipse) as compiled jars with attached source jars - don't include them as modules.  This allows Intellij/Eclipse to skip a LOT of bookkeeping.

Anton Arhipov replied on Tue, 2011/11/01 - 4:39pm

In eclipse, you probably need one more hotkey: Ctrl+3 :) Performance issues. Well, tried variety of Eclipse distributions. Up to a certain amount of plugins it works fine, but still with some lags in situations where you do not expect that to happen. Same with IntelliJ.

Lindsay Gordon replied on Wed, 2011/11/09 - 5:17pm

Great comment thread guys!  Discussion like this is what DZone is all about, I'm glad to see some conversation and feedback. 

Jakub Holý replied on Fri, 2011/11/11 - 7:59am in response to: Martijn Stellinga

@Martijn Thanks for the info &  link

Robert Craft replied on Thu, 2012/01/26 - 5:55am

I'm working in Windows with IDEA (8 years) and Eclipse (this year). Speed is no issue in any of them - search is for instance faster in IDEA every time, also Eclipse is more prone to (Not responding) in window title. But this can all be put aside if Eclipse was just as intelligent with templates, completion and refactoring. There is still a loooong way to go for Eclipse here. Eclipse is more than IDEA, but as Java IDE it's IDEA all the way.

Spring Security

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.