365

I have heard from people who have switched either way and who swear by the one or the other.

Being a huge Eclipse fan but having not had the time to try out IntelliJ, I am interested in hearing from IntelliJ users who are "ex-Eclipsians" some specific things that you can do with IntelliJ that you can not do with Eclipse.

Note: This is not a subjective question nor at all meant to turn into an IDE holy war. Please downvote any flamebait answers.

Craig P. Motlin
  • 26,452
  • 17
  • 99
  • 126
Epaga
  • 38,231
  • 58
  • 157
  • 245
  • 5
    http://stackoverflow.com/questions/461255/things-possible-in-eclipse-that-arent-possible-in-intellij – Instantsoup Jan 20 '09 at 15:11
  • 1
    I went from Eclipse to Netbeans to IntelliJ rubyMine and each one was a 'step up' from the previous. I can't saw what specifically (hence this isn't an answer) as it was a while a go but the biggest jump up was to rubyMine which was just more "integrated" and seemed to have more functionality and presented things in an easier to use way. It also seemed to handle gem issues, dependencies and the like better than others. – junky May 03 '12 at 17:09
  • I want to switch from intelliJ to Eclipse (because of android development), therefore this type question and answers are very useful. – chrome Jan 08 '13 at 08:30
  • 8
    @chrome Android is now switching the other way: http://developer.android.com/sdk/installing/studio.html – Daniel Alexiuc May 22 '13 at 06:04
  • 1
    I have as many of these postings as I can and all the answers point to things that can actually be done eclipse, sometimes easier IMHO. I want to feel like I got my $ worth with intellij but the only reason I bought it was the Javascript autocomplete. I could have just bought webstorm for cheaper if this is all I get. There is probably an eclipse plugin that does the same thing too. Frankly I think eclipse is more consistent and I miss the Perspectives feature. – dres Oct 26 '13 at 14:04

41 Answers41

185

CTRL-click works anywhere

CTRL-click that brings you to where clicked object is defined works everywhere - not only in Java classes and variables in Java code, but in Spring configuration (you can click on class name, or property, or bean name), in Hibernate (you can click on property name or class, or included resource), you can navigate within one click from Java class to where it is used as Spring or Hibernate bean; clicking on included JSP or JSTL tag also works, ctrl-click on JavaScript variable or function brings you to the place it is defined or shows a menu if there are more than one place, including other .js files and JS code in HTML or JSP files.

Autocomplete for many languagues

Hibernate

Autocomplete in HSQL expressions, in Hibernate configuration (including class, property and DB column names), in Spring configuration

<property name="propName" ref="<hit CTRL-SPACE>"

and it will show you list of those beans which you can inject into that property.

Java

Very smart autocomplete in Java code:

interface Person {
    String getName();
    String getAddress();
    int getAge();
}
//---
Person p;
String name = p.<CTRL-SHIFT-SPACE>

and it shows you ONLY getName(), getAddress() and toString() (only they are compatible by type) and getName() is first in the list because it has more relevant name. Latest version 8 which is still in EAP has even more smart autocomplete.

interface Country{
}
interface Address {
    String getStreetAddress();
    String getZipCode();
    Country getCountry();
}
interface Person {
    String getName();
    Address getAddress();
    int getAge();
}
//--- 
Person p;
Country c = p.<CTRL-SHIFT-SPACE>

and it will silently autocomplete it to

Country c = p.getAddress().getCountry();

Javascript

Smart autocomplete in JavaScript.

function Person(name,address) {
    this.getName = function() { return name };
    this.getAddress = function() { return address };
}

Person.prototype.hello = function() {
    return "I'm " + this.getName() + " from " + this.get<CTRL-SPACE>;
}

and it shows ONLY getName() and getAddress(), no matter how may get* methods you have in other JS objects in your project, and ctrl-click on this.getName() brings you to where this one is defined, even if there are some other getName() functions in your project.

HTML

Did I mention autocomplete and ctrl-clicking in paths to files, like <script src="", <img src="", etc?

Autocomplete in HTML tag attributes. Autocomplete in style attribute of HTML tags, both attribute names and values. Autocomplete in class attributes as well.
Type <div class="<CTRL-SPACE> and it will show you list of CSS classes defined in your project. Pick one, ctrl-click on it and you will be redirected to where it is defined.

Easy own language higlighting

Latest version has language injection, so you can declare that you custom JSTL tag usually contains JavaScript and it will highlight JavaScript inside it.

<ui:obfuscateJavaScript>function something(){...}</ui:obfuscateJavaScript>

Indexed search across all project.

You can use Find Usages of any Java class or method and it will find where it is used including not only Java classes but Hibernate, Spring, JSP and other places. Rename Method refactoring renames method not only in Java classes but anywhere including comments (it can not be sure if string in comments is really method name so it will ask). And it will find only your method even if there are methods of another class with same name. Good source control integration (does SVN support changelists? IDEA support them for every source control), ability to create a patch with your changes so you can send your changes to other team member without committing them.

Improved debugger

When I look at HashMap in debugger's watch window, I see logical view - keys and values, last time I did it in Eclipse it was showing entries with hash and next fields - I'm not really debugging HashMap, I just want to look at it contents.

Spring & Hibernate configuration validation

It validates Spring and Hibernate configuration right when you edit it, so I do not need to restart server to know that I misspelled class name, or added constructor parameter so my Spring cfg is invalid.

Last time I tried, I could not run Eclipse on Windows XP x64.

and it will suggest you person.name or person.address. Ctrl-click on person.name and it will navigate you to getName() method of Person class.

Type Pattern.compile(""); put \\ there, hit CTRL-SPACE and see helpful hint about what you can put into your regular expression. You can also use language injection here - define your own method that takes string parameter, declare in IntelliLang options dialog that your parameter is regular expression - and it will give you autocomplete there as well. Needless to say it highlights incorrect regular expressions.

Other features

There are few features which I'm not sure are present in Eclipse or not. But at least each member of our team who uses Eclipse, also uses some merging tool to merge local changes with changes from source control, usually WinMerge. I never need it - merging in IDEA is enough for me. By 3 clicks I can see list of file versions in source control, by 3 more clicks I can compare previous versions, or previous and current one and possibly merge.

It allows to to specify that I need all .jars inside WEB-INF\lib folder, without picking each file separately, so when someone commits new .jar into that folder it picks it up automatically.

Mentioned above is probably 10% of what it does. I do not use Maven, Flex, Swing, EJB and a lot of other stuff, so I can not tell how it helps with them. But it does.

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
Pavel Feldman
  • 4,621
  • 7
  • 30
  • 31
  • 26
    The two examples about auto-completing java code work identically in eclipse. Could someone with more rep delete just the java examples please? – Craig P. Motlin Jan 20 '09 at 13:11
  • 9
    Most of your examples are available in Eclipse, either directly or via 3rd party plugins. I know of no one who uses an external tool for svn merge in Eclipse. For spring/hibernate/javascript editors (and autocomplete) there are 3rd party plugins. As for regex and jsp EL, you beat me :) – Yoni Feb 01 '09 at 03:54
  • Last time I saw JS plugin for eclipse, it definitely was better than nothing, but still not so powerful as IDEA. At least I did not saw autocomplete in one .js file using fields and methods from another one. May be things has changed, – Pavel Feldman Feb 02 '09 at 00:04
  • 1
    The Jboss Tools plugin adds autocomplete of Hibernate and JSF expressions. – Damo Apr 29 '09 at 11:59
  • 4
    For the eclipse debugging view there is an option to show the contents of the collections rather than the implementation details. For lists and sets, it'll show their contents. For maps, it'll show a list of key-value pairs. It's also possible to set custom displays up. – deterb Jun 19 '09 at 16:48
  • The Ctrl+Click also works in ant build xml+props file combinations :) – talonx Jan 15 '10 at 16:59
  • SpringIDE (that you can get bundled in Spring Tool Suite) gives you strong typing of Spring configuration file. No need to restart a server to check this at runtime. With all due respect to IntelliJ, there are just too much inexact information in this answer. – Pascal Thivent Apr 27 '10 at 17:41
  • "With all due respect to IntelliJ, there are just too much inexact information in this answer." It was written almost a year ago and it is community wiki, you are welcome to correct it. I don't use Eclipse that often, so I obviously may not know something about it. – Pavel Feldman Apr 29 '10 at 21:58
  • 1
    Eclipse 3.7 (Indigo), also auto-completes class names in Spring configuration. – stivlo Aug 02 '11 at 20:29
  • @PavelFeldman how do you get the JSP EL autocomplete of classes workign correctly (I have intellij enterprise 11.1.3), it is not offering up the correct options. Is there a specific setting I need to alter ? – NimChimpsky Oct 02 '12 at 20:23
  • Eclipse's Dynamic Web Projects automatically include the contents of the WEB-INF/lib folder in the project's classpath. – nitind Dec 04 '13 at 17:48
  • Intellij has bad gradle support. i'm running into a plethora of gradle build issues that my workspace complains about. otherwise, i'm doing my best to work around it as it is an excellent IDE – coderatchet Dec 20 '13 at 00:55
  • IntelliJ doesn't have perspectives :) – Cornelius Jan 22 '14 at 09:59
  • @deterb and others: In your 'you can do that in Eclipse' comments, could you provide details? Which Eclipse version, with what plug-ins, and steps for turning on and using the feature? – Michael Scheper Feb 10 '14 at 00:47
  • @MichaelSheper most of these features are in the documentation and have been around a while (note the '09 date on mine). I'll look into adding more detail when I get a chance to later. – deterb Feb 14 '14 at 15:46
  • I'm using eclps since 2006, but I tried recently Intellij and I'm surprised. You need time to test it, but after a few weeks you see the big differences with eclps, it has a lot of tiny useful mini-tools integrated that make you realy productive! Plugins are better integrated and a lot of things are detected, suggested or installed automatic. In other words, eclps is a powerful tool and perhaps easier to begin with.. but when you are experienced developer and you want to spend your time actually programming and not fighting with configurations and buggy plugins I recommend you to try it out! – Tano Mar 21 '14 at 16:20
81

There is only one reason I use intellij and not eclipse: Usability

Whether it is debugging, refactoring, auto-completion.. Intellij is much easier to use with consistent key bindings, options available where you look for them etc. Feature-wise, it will be tough for intellij to catch up with Eclipse, as the latter has much more plugins available that intellij, and is easily extensible.

Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
amit
  • 10,612
  • 11
  • 61
  • 60
  • 10
    It is intelligent, and damn fast. This adds up to a lot of usability features. Traversing to a subclass or implementing class, find-in-path, find usages, etc. happens so fast. Auto-complete happens inline, just a tab will insert it. Auto complete is also smart, just not pure suggestions but the IDE thinks of names etc. for you. – Ravindranath Akila Nov 24 '12 at 10:54
  • There is more than just one reason to use IntelliJ. Usability isn't even top of the list. There are more features in IntelliJ than Eclipse. IntelliJ has fewer plugins in total, but more 'quality' plugins. So, this answer, despite the up-votes, is wrong. – Software Engineer Dec 03 '13 at 14:52
  • 2
    @EngineerDollery I wouldn't say it's "wrong", since amit said "There is only one reason **I** use intellij and not eclipse", not "There is only one reason **to** use intellij and not eclipse". – Max Nanasy Dec 09 '13 at 21:06
54

Probably is not a matter of what can/can't be done, but how.

For instance both have editor surrounded with dock panels for project, classpath, output, structure etc. But in Idea when I start to type all these collapse automatically let me focus on the code it self; In eclipse all these panels keep open leaving my editor area very reduced, about 1/5 of the total viewable area. So I have to grab the mouse and click to minimize in those panels. Doing this all day long is a very frustrating experience in eclipse.

The exact opposite thing happens with the view output window. In Idea running a program brings the output window/panel to see the output of the program even if it was perviously minimized. In eclipse I have to grab my mouse again and look for the output tab and click it to view my program output, because the output window/panel is just another one, like all the rest of the windows, but in Idea it is treated in a special way: "If the user want to run his program, is very likely he wants to see the output of that program!" It seems so natural when I write it, but eclipse fails in this basic user interface concept.

Probably there's a shortcut for this in eclipse ( autohide output window while editing and autoshow it when running the program ) , but as some other tens of features the shortcut must be hunted in forums, online help etc while in Idea is a little bit more "natural".

This can be repeated for almost all the features both have, autocomplete, word wrap, quick documentation view, everything. I think the user experience is far more pleasant in Idea than in eclipse. Then the motto comes true "Develop with pleasure"

Eclipse handles faster larger projects ( +300 jars and +4000 classes ) and I think IntelliJ Idea 8 is working on this.

All this of course is subjective. How can we measure user experience?

OscarRyz
  • 196,001
  • 113
  • 385
  • 569
  • 18
    in eclipse you can press control-m to min/max the edit window, or double-click its editor tab - this helps a great deal – Scott Stanchfield Nov 03 '08 at 17:28
  • Wow... thanks a lot. It would be very helpful if eclipse had a way I know this ( beside reading the hotkey cheat sheet ) Thanks a lot. Is there a way yo change to the output window? – OscarRyz Dec 06 '08 at 02:19
  • ALT-SHIFT-Q brings up a Show View window... C is for console ALT-SHIFT-Q, C is the shortcut to go to the console. – Instantsoup Jan 20 '09 at 16:53
  • 7
    Ctrl+Shift+L shows you a list of hotkeys available in the current context. – Dan Berindei Apr 01 '09 at 15:37
  • 3
    Double-click on a sub-window title -- ANY sub-window -- and your sub-window blows out to the full screen. Do it again for restore. Minimize the panel with the console, and then when output happens, the console pops up instantly. – Ian Jun 25 '11 at 08:40
  • Eclipse git integration has no means to see in the same UI piece what files were changed in sandbox AND diff these files. It's possible to open the changed files list, remember one file, close file list, diff the file in project explorer, repeat. That pretty much illustrates the approaches. – Victor Sergienko May 21 '12 at 07:26
  • Sounds like the Git Staging View. – nitind Dec 04 '13 at 17:55
  • There is a setting in eclipse to pop up the console whenever anything is written to this. It was on by default for me and I turned it off so I could do more work while the program compiled/ran. – AnthonyW Feb 19 '14 at 19:58
  • I hate the fact all the things keep hiding in IntelliJ. I work on wide large monitors with hi res. So for me I'm just like 'oh where did that go now, stop hiding on me dangnabit!!' – Andrew S Apr 14 '14 at 01:26
  • @AndrewS Set "Pinned Mode" on for the tool windows you want to still see when they're inactive. – Gwyn Evans Apr 29 '14 at 21:33
44

Idea 8.0 has the lovely ctrl+shift+space x 2 that does the following autocomplete:

 City city = customer.<ctrl-shift-space twice>

resolves to

 City city = customer.getAddress().getCity();

through any number of levels of getters/setters.

0x6C38
  • 6,796
  • 4
  • 35
  • 47
krosenvold
  • 75,535
  • 32
  • 152
  • 208
33

Don't forget "compare with clipboard".

Something that I use all the time in IntelliJ and which has no equivalent in Eclipse.

Daniel Alexiuc
  • 13,078
  • 9
  • 58
  • 73
31

My favorite shortcut in IntelliJ that has no equivalent in Eclipse (that I've found) is called 'Go to symbol'. CTRL-ALT-SHIFT-N lets you start typing and glob up classes, method names, variable names, etc, from the entire project.

0x6C38
  • 6,796
  • 4
  • 35
  • 47
Paul Morie
  • 15,528
  • 9
  • 52
  • 57
27

I tried to switch to IntelliJ because of the new Android Studio. But I'm very disappointed now. I'm using Eclipse with the Code Recommanders Plugin. Here is a simple example why Eclipse is so awesome:

I want to create a new SimpleTimeZone. SimpleTimeZone has no Constructor with zero arguments.

Ctrl + Space in Eclipse

enter image description here

Ctrl + Space in IntelliJ

enter image description here

In IntelliJ I get no informations what kind of constructors SimpleTimeZone has.

After Enter in Eclipse

enter image description here

I get the previously selected constructor filled with predefined variable names. And I can see the type of every argument. With Code Recommanders Eclipse guesses the right constructor by the previously defined variable types in the current scope and fills the constructor with these vars.

After Enter in IntelliJ nothing happens. I get an empty constructor. I have to press Ctrl + P to see the expected arguments.

enter image description here

0x6C38
  • 6,796
  • 4
  • 35
  • 47
passsy
  • 5,162
  • 4
  • 39
  • 65
25

If you have the cursor on a method then CTRL+SHIFT+I will popup the method implementation. If the method is an interface method, then you can use up- and down- arrows to cycle through the implementations:

Map<String, Integer> m = ...
m.contains|Key("Wibble");

Where | is (for example) where your cursor is.

0x6C38
  • 6,796
  • 4
  • 35
  • 47
oxbow_lakes
  • 133,303
  • 56
  • 317
  • 449
  • 4
    Actually in Eclipse (at least the version I'm using), when you put your cursor on the name of a method and hit CTRL+T you get the entire hierarchy tree, from the topmost interface down to the leaf implementations, and can jump to any of them. – Yuval Nov 10 '08 at 14:37
  • 2
    In Eclipse you can also Ctrl+Click the method name to jump to the method definition / implementation (depending on context) – qualidafial Dec 31 '08 at 15:50
  • 8
    The point is that you're not actually navigating to the implementation. It is just shown popup, just like javadoc etc. – jackrabbit Oct 27 '09 at 20:26
  • 1
    In Eclipse you just hover the method name with Shift to open popup with its implementation – Victor Jan 30 '14 at 10:52
24

IntelliJ has some pretty advanced code inspections (comparable but different to FindBugs).

Although I seriously miss a FindBugs plugin when using IntelliJ (The Eclipse/FindBugs integration is pretty cool).

Here is an official list of CodeInspections supported by IntelliJ

EDIT: Finally, there is a findbugs-plugin for IntelliJ. It is still a bit beta but the combination of Code Inspections and FindBugs is just awesome!

javanna
  • 59,145
  • 14
  • 144
  • 125
Mo.
  • 15,033
  • 14
  • 47
  • 57
  • yeah findbugs is one of the few static code analyzers that actually truly finds practical honest-to-goodness bugs. :) – Epaga Oct 27 '08 at 13:16
  • Do you have a specific example of its code inspection? What kind of stuff can it detect? – Epaga Oct 27 '08 at 13:27
  • Another link about inspections: http://hamletdarcy.blogspot.com/2008/04/10-best-idea-inspections-youre-not.html – Mo. Oct 27 '08 at 13:59
  • 8
    I find IntelliJ's code inspection finds more bugs, has useful quick fixes, it can give warnings and fix lines as you type them. (You don't have to save the file and it doesn't have to compile) These niceties make it more practical to fix bugs as soon as possible. – Peter Lawrey Feb 07 '09 at 09:25
16

Far, far, far more refactorings.

15

One thing I use regularly is setting a breakpoint, but then controlling what it does. (At my last job, most everyone else used Eclipse... I remember being surprised that no one could find how to do this in Eclipse.)

For example, can have the breakpoint not actually stop, but just log a message to the console. Which means, I don't have to litter my code with "System.out.println(...)" and then recompile.

jgindin
  • 948
  • 8
  • 15
  • 2
    You can do this with conditional breakpoints in eclipse but it's a bit cheeky .eg. true – HaveAGuess May 05 '11 at 15:11
  • I think intelliJ lets you set more complex hit counts, doesn't it? – Kimball Robinson May 13 '13 at 18:26
  • 3
    It's simpler to find now in eclipse - it displays conditions in the breakpoints view now (so you know they're available). You can break on counts, enter arbitrary code, like `System.out.println("here"); false` to print but not break (last statement is a boolean expression that determines if we should break) – Scott Stanchfield May 15 '13 at 20:02
15

There are many things that idea solves in a much simpler way, or there's no equivalent:

  • Autocomplete actions: Doing ctrl+shift+a you can call any idea action from the keyboard without remembering its key combination... Think about gnome-do or launchy in windows, and you've got the idea! Also, this feature supports CamelCasing abbreviations ;)

  • Shelf: Lets you keep easily some pieces of code apart, and then review them through the diff viewer.

  • Local history: It's far better managed, and simpler.

  • SVN annotations and history: simpler to inspect, and also you can easily see the history only for such a part of a whole source file.

  • Autocomplete everywhere, such as the evaluate expression and breakpoint condition windows.

  • Maven integration... much, much simpler, and well integrated.

  • Refactors much closer to the hand, such as loops insertion, wrapping/casting, renaming, and add variables.

  • Find much powerful and well organized. Even in big projects

  • Much stable to work with several branches of a big project at the same time (as a former bugfixer of 1.5Gb by branch sources, and the need to working in them simultaneously, idea shown its rock-solid capabilities)

  • Cleaner and simpler interface...

  • And, simpler to use only with the keyboard, letting apart the need of using the mouse for lots of simple taks, saving you time and giving you more focus on the code... where it matters!

And now, being opensource... the Idea user base will grow exponentially.

0x6C38
  • 6,796
  • 4
  • 35
  • 47
Ari
  • 53
  • 2
  • 9
  • 2
    Autocomplete actions = quick access in eclipse; I don't see how local history can be easier than in eclipse... – Scott Stanchfield May 15 '13 at 20:04
  • As Scott indicated, it's Ctrl+3. Content assist is also available when evaluation expressions and setting conditional breakpoints. I'm not sure how much closer to hand the mentioned refactorings are than what's proposed by Ctrl+1 and Ctrl+2. Much of the rest sounds subjective. – nitind Dec 04 '13 at 17:52
14

Structural search and replace.

For example, search for something like:

  System.out.println($string$ + $expr$);

Where $string$ is a literal, and $expr$ is an expression of type my.package.and.Class, and then replace with:

  $expr$.inspect($string$);
Darron
  • 21,309
  • 5
  • 49
  • 53
  • 1
    Actually you can search for the type casts /()-operator/ in your code, virtually impossible with plain text search – Karl Nov 20 '08 at 11:39
13

My timing may be a little off in terms of this thread, but I just had to respond.

I am a huge eclipse fan -- using it since it's first appearance. A friend told me then (10+ years ago) that it would be a player. He was right.

However! I have just started using IntelliJ and if you haven't seen or used changelists -- you are missing out on programming heaven.

The ability to track my changed files (on my development branch ala clearcase) was something I was looking for in a plugin for eclipse. Intellij tracks all of your changes for a single commit, extremely easy. You can isolate changed files with custom lists. I use that for configuration files that must be unique locally, but are constantly flagged when I sync or compare against the repository -- listing them under a changelist, I can monitor them, but neatly tuck them away so I can focus on the real additions I am making.

Also, there's a Commit Log plugin that outputs a text of all changes for those SCCS that aren't integrated with your bug tracking software. Pasting the log into a ticket's work history captures the files, their version, date/time, and the branch/tags. It's cool as hell.

All of this could be supported via plugins (or future enhancements) in eclipse, I wager; yet, Intellij makes this a breeze.

Finally, I am really excited about the mainstream love for this product -- the keystrokes, so it's painful, but fun.

G Craig
  • 1
  • 1
  • 2
  • I really like the changelists feature. It is similar to a VCS independent set of patches/shelves that you can work on independently and which can be associated with they can also be associated with your issue tracker. You have local history (like a mini VCS) tracking your changes while you work at almost the line level detail so you can go back to almost any point in time if you need to. Also, when you switch tasks, all IDEA remembers the state of the IDE for the new task and restores open files, window positions, etc. – sylvanaar Aug 08 '11 at 01:37
  • Changelists are actually an SVN feature. IntelliJ just allows you to see and manage them where the Eclipse SVN plugins do not. – Neil Traft Oct 17 '11 at 16:36
12

The IntelliJ debugger has a very handy feature called "Evaluate Expression", that is by far better than eclipses pendant. It has full code-completion and i concider it to be generally "more useful".

Mo.
  • 15,033
  • 14
  • 47
  • 57
  • 8
    Eclipse also has an expression evaluator that offers code completion. Go to Window -> Show View -> Debug -> Display When stopped at a breakpoint in the debugger you can evaluate arbitrary expressions in that Display View. – laz Oct 27 '08 at 14:56
11

Well, for me it's a thousand tiny things. Some of the macros, the GUI layout in general in Eclipse I find awful. I can't open multiple projects in different windows in Eclipse. I can open multiple projects, but then it's view based system swaps a bunch of things around on me when I switch files. IntelliJ's code inspections seem better. Its popup helpers to fix common issues is nice. Lots of simple usability things like the side bar where I can hover over a hot spot and it'll tell me every implementing subclass of a method or the method I'm implementing and from where.

Whenever I've had to use, or watch someone use, Eclipse it seems like they can do most of the things I can do in IntelliJ, but it takes them longer and it's clunkier.

Chris Kessel
  • 5,583
  • 4
  • 36
  • 55
9

Introduce variable. (Ctrl+Alt+V on Windows, Cmd+Alt+V on OSX)

Lets say you call a method, service.listAllPersons() Hit Ctrl+Alt+V and Enter, and variable for return value from method call is inserted:

List<Person> list = service.listAllPersons();

Saves you typing, and you don't have to check the return type of the method you are calling. Especially useful when using generics, e.g.

new ArrayList<String>()

[introduce variable]

ArrayList<String> stringArrayList = new ArrayList<String>();

(of course you can easily change the name of the variable before hitting Enter)

0x6C38
  • 6,796
  • 4
  • 35
  • 47
rlovtang
  • 4,860
  • 2
  • 30
  • 30
  • 13
    This is Ctrl+2 L in Eclipse. – Micke Aug 06 '09 at 17:17
  • 2
    Nice, I didn't know, and neither did any of the Eclipse users I have asked. Has this feature been part of Eclipse for a long time? – rlovtang Aug 16 '09 at 20:32
  • 3
    Quite a long time... If you use quickfix, `control+1` (the most obvious key binding in the world, eh?), it suggests things you can do at the current cursor location, similar to intentions in IDEA. It lists "assign local", "assign field" and other options, for example. `control+2, L` is the shortcut for it. – Scott Stanchfield May 15 '13 at 20:09
  • In eclipse, once you chose `ctrl+2, L`, you can still change the type of the created variable to either the right-hand side type (by default), or any supertype : the variable type is selectable with TAB. – Gaetan Feb 04 '14 at 09:09
8

IntelliJ has intellisense and refactoring support from code into jspx documents.

krosenvold
  • 75,535
  • 32
  • 152
  • 208
  • Could you clarify what you mean by intellisense? Eclipse has auto-completion as well, but do you mean something else? – Epaga Oct 27 '08 at 12:52
  • Eclipse does not have autocompletion in jspx documents AFAIK. In regular jsp yes, jspx no. – krosenvold Oct 27 '08 at 21:03
  • 3
    He means that if you have a JSP that refers to a property on a POJO, and you rename the property, your JSP is updated correctly. IntelliJ's JSP support kicks Eclipse/WTP! – erickson Oct 27 '08 at 21:03
  • 2
    I can't get Eclipse's auto complete to work in JSP EL expressions, period. JSP or JSPX, it doesn't matter, it's just clueless. IntelliJ handles tagx and jspx just as you'd expect: like a tag or jsp file. – erickson Oct 27 '08 at 21:04
  • Its nice to see how eclipse users vote down the things they dont like. If my observations are wrong, please respond with a comment. Tell me how to do this in eclipse ! – krosenvold Oct 31 '08 at 21:03
7

For me, it's IDEA's maven support, especially in version 9 is second to none. The on-the-fly synchronizing of the project to the maven model is just fantastic and makes development pleasant.

mdma
  • 56,943
  • 12
  • 94
  • 128
6

Intellij has a far superior SVN plug-in than either Subversive or Subclipse and it works! The amount of time we've wasted merging source files using Eclipse doesn't bear thinking about. This isn't an issue with IntelliJ because the plugin helps you much more.

Also the Subclipse plugin is unreliable - we regularly have instances where the plugin doesn't think there has been any code checked in to SVN by other developers, but there has - the CI server has processed them!

Tony Ruddock
  • 11
  • 1
  • 1
  • exactly, svn support is superb in idea, while subclipse/subversive are buggy, clumsy and not very reliable; same goes for git, actually I don't remember any reasonable git intergration for eclipse and intelliJ handles it very well – Kamil Mikolajczyk Feb 21 '14 at 09:23
  • Personally I think you should do all your version control on the command line, even if your IDE can do it. When you do that on the command line, then you will know how to bash script it later, which could really speed up your development. Sometimes my co-workers ask me for help with subclipse or git's eclipse plugin, I just tell them to stop using it and do it on the command line. – msknapp May 15 '14 at 00:44
4

VIM Emulator. This plugin provides nearly complete vi/vim/gvim emulation while editing files in IDEA. The following functionality is supported:

  • Motion keys
  • Deletion/Changing
  • Insert mode commands
  • Marks
  • Registers
  • VIM undo/redo
  • Visual mode commands
  • Some Ex commands
  • Some :set options
  • Full VIM regular expressions for search and search/replace
  • Macros
  • Diagraphs
  • Command line history
  • Search history
  • Jumplists
  • VIM help

some comments about this plugin from http://plugins.jetbrains.net/plugin/?id=164

I can't see ever going back to any other ide because of this plugin.. Best of both worlds... Awesome!. that's what i was lacking in all IDEs.
Maciek Kreft
  • 882
  • 9
  • 14
  • I agree, I couldn't live without my IdeaVim plugin, however to be fair there is a Vim plugin for Eclipse, aptly named VimPlugin (http://vimplugin.org) – Keith Jun 18 '10 at 13:43
  • 3
    Vwrapper is another Vim Eclipse plugin. And it works even better than the Idea Vim plugin (repeat keys work). Vwrapper doesn't handle search and replace from the command-line, though (although search works great), nor does it allow defining macros interactively. Agreed that Vim support is essential in an IDE. Wouldn't use Eclipse or Idea without it! – Brent Faust Jan 16 '12 at 22:34
  • 1
    The http://viableplugin.com/ is very good for eclipse. I am using the intellij one as well and I find that the intellij one occasionally gets hung up in the editor in some circumstances and doesn't respond to commands. – John Lemp Jun 12 '12 at 11:56
4

One of the good points in my opinion is the Dependency Structure Matrix: http://www.jetbrains.com/idea/features/dependency_analysis.html#link0

There's a good introduction to DSM usage and benefits in Lattix' website (a standalone product): http://www.lattix.com/files/dl/slides/s.php?directory=4tour

Herrmann
  • 1,152
  • 8
  • 15
3

A few other things:

  • propagate parameters/exceptions when changing method signature, very handy for updating methods deep inside the call stack
  • SQL code validation in the strings passed as arguments to jdbc calls (and the whole newly bundled language injection stuff)
  • implemented in/overwritten in icons for interfaces & classes (and their methods) and the smart implementation navigation (Ctrl+Alt+Click or Ctrl+Alt+B)
  • linking between the EJB 2.1 interfaces and bean classes (including refactoring support); old one, but still immensely valuable when working on older projects
Andrei
  • 764
  • 7
  • 14
2

Two things that IntelliJ does that Eclipse doesn't that are very valuable to me:

Method separators: those faint gray lines between methods make code much more readable

Text anti-aliasing: makes code look so nice in the IDE

yalestar
  • 9,334
  • 6
  • 39
  • 52
  • 2
    I actually found IntelliJ's anti-aliasing to be much worse than Eclipse. This was a few versions of IntelliJ ago however. Has it been improved? – laz Nov 10 '08 at 14:26
  • I use a Verdana proportional font which I think looks nicer than using anti-aliasing. – Peter Lawrey Feb 07 '09 at 09:21
2

One very useful feature is the ability to partially build a Maven reactor project so that only the parts you need are included.

To make this a little clearer, consider the case of a collection of WAR files with a lot of common resources (e.g. JavaScript, Spring config files etc) being shared between them using the overlay technique. If you are working on some web page (running in Jetty) and want to change some of the overlay code that is held in a separate module then you'd normally expect to have to stop Jetty, run the Maven build, start Jetty again and continue. This is the case with Eclipse and just about every other IDE I've worked with. Not so in IntelliJ. Using the project settings you can define which facet of which module you would like to be included in a background build. Consequently you end up with a process that appears seamless. You make a change to pretty much any code in the project and instantly it is available after you refresh the browser.

Very neat, and very fast.

I couldn't imagine coding a front end in something like YUI backing onto DWR/SpringMVC without it.

Gary
  • 7,167
  • 3
  • 38
  • 57
2

Data flow analysis : inter-procedural backward flow analysis and forward flow analysis, as described here. My experiences are based on Community Edition, which does data flow analysis fairly well. It has failed (refused to do anything) in few cases when code is very complex.

javanna
  • 59,145
  • 14
  • 144
  • 125
Ville Laitila
  • 1,187
  • 11
  • 18
2

There is one thing that IntelliJ does much much better than Eclipse and that is empty your pockets!

I do however prefer using it and one big advantage it has over Eclipce is the way it synchronises with the file system, for big projects and slow computers (yes in work environments the PC's are a lot slower than our ones at home) Eclipse seems to struggle where IntelliJ seems to be quicker albeit with a slower initial indexing time.

IntelliJ Community edition obviously makes using it free but you soon want those extra refactoring and nice little goodies not included in the CC edition.

In my opinion, its generally a better user experience but whether its worth the cost is a question for each developer to answer themselves.

But lets be grateful we have up to three great IDEs for Java right now with NetBeans getting better all the time.

Shawn Vader
  • 12,285
  • 11
  • 52
  • 61
  • 3
    IntelliJ Ultimate Edition is indeed not free, but as a developer, I use my IDE about 8 to 10 hours a day. So I don't see his reasonable price as a flaw!! – Romain Linsolas Oct 28 '10 at 10:07
2

Something which I use in IntelliJ all the time is refactoring as I type. I have re-written classes from a printout (originally written in eclipse) using both IDEs and I used about 40% less key strokes/mouse clicks to write the same classes in IntelliJ than eclipse.

I wouldn't want to use Eclipse until they support as much refactoring with incomplete pieces of code.

Here is a longer list of features in IntelliJ 8.0/8.1 [http://www.jetbrains.com/idea/features/index.html]

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
2

Preamble to my answer: My use of Eclipse is limited. We needed a Java IDE to work on both Windows and Mac and the Mac port slowed down day by day. This was years ago and I'm sure it's OK now. But that is what got us to switch to IntelliJ and we've been happy with it.

Now for my answer: One big difference I haven't seen mentioned yet is that tech support is better with IntelliJ/Jet Brains. We send an e-mail to JetBrains and get a definitive answer back in less than an hour. Looking for answers to Eclipse problems results in the usual, "You stupid idiot" answers (usually a small number of the replies) along with the much larger number of insightful, helpful replies. But it takes some sorting through to get the real answer.

Jim Dodd
  • 241
  • 2
  • 3
  • Eclipse is open source. No one is paid for answering questions or fixing bugs. Buy commercial Eclipse-based IDE e.g. MyEclipse and get support for your money. Quick stats: I've reported to JetBrains 56 bugs, 23 of them are closed; from 65 bugs reported to Eclipse 33 are closed. The only difference is that JetBrains fixes bugs slightly faster than Eclipse. – Victor Jan 30 '14 at 11:15
2

First of all I love intellij. There are at least a hundred features it has that eclipse lack. I'm talking magnitudes better in reliability and intelligence that no hyperbole can describe when it comes to refactoring, renaming, moving and others which have already been mentioned.

BUT, there is one thing that intellij does not allow which eclipse does. It does not allow running multiple projects at once under the same vm.

When you have separate projects for the front, middle, core, agents..etc, where they all have to interact with each other, you can not quickly modify and debug at the same time, afaik. The only way I current cope with this is to use ant scripts to deploy and update jars in dependent projects, or use maven.

Eclipse allows multiple projects to be debugged under one ide vm instance.

casperOne
  • 73,706
  • 19
  • 184
  • 253
blicket
  • 1
  • 1
  • 4
    This should've been posted in [Things Eclipse can do that IntelliJ Can't](http://stackoverflow.com/questions/461255/things-possible-in-eclipse-that-arent-possible-in-intellij), not the other way around. – Neil Traft Nov 17 '11 at 07:08
  • IntelliJ does this without any problems at all. This answer is simply wrong. – Software Engineer Dec 03 '13 at 14:55
1

I have discovered recently at least two advanteges of IntelliJ IDEA over Eclipse.

If one tries to use code formating in the JSP code editor the JSP scriptlets get broken. Eclipse is getting a little bit crazy, it ads random pieces of code here and there. IDEA behaves very nicely.

The other thing is speed of deployment of the application on the JBoss Server. IntelliJ is replacing the application in the JBoss's tmp folder, so the redeployment is really fast. Eclipse WTP is replacing application in the deploy folder, which, as it turns out, lasts much longer.

Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77
1

At current, it is the only one that can have tabs torn out into another window. Handy when you have more screens.

Scoobie
  • 1,097
  • 2
  • 12
  • 22
0

Open a project from a Maven POM. Just select "Open project..." navigate to your top level pom.xml and hit Enter :) NetBeans now has this feature as well.

rlovtang
  • 4,860
  • 2
  • 30
  • 30
0

There are a number of features and workflows that are different in the two, as is evident in all the answers. However, I think that in deciding what framework to use one much also consider the general productivity improvement one can make with each tool.

I am a big fan of Netbeans and Eclipse and have used both for many years. They are excellent tools and depending on what you are doing, you may want to choose one or the other.

However, about six months ago, while working on a complex java web project involving a lot of javascript front end code for a HMT5 ui, I was forced to look for alternatives to Eclipse due to a js autocomplete bug. I was so desperate that I was considering going back to a simple text editor for my js code!!!

It is only by luck that I ran across Intellij Idea (no time to research tools unfortunately).

While it takes some time to get used to the Idea way of doing things, special features aside, the productivity increase it offers from small things left and right is the biggest asset in my opinion. It simply works better for me and I am now a subscription-paying client of Idea Ultimate. Once you get used to this, its is very difficult to go back to anything else.

Nothing beats free and I am a big fan of open source, but in the end if you are doing this for a living, being able to do things faster pays out every time.

CuNimb
  • 164
  • 2
  • 7
0

I think you can stick to either of these IDEs. The best sign to not to "worry about missing a giant benefit in the IDE you are not using" is the very long arguments we have seen between Eclipse fans and IntelliJ fans. This is a good sign that both sides have almost the same power which has led this long discussion to survive.

Ali Motevallian
  • 1,250
  • 10
  • 15
0

I don't remember if word/line/method/class wrap is possible in Eclipse

In Intellij Idea you use Ctrl+W

0x6C38
  • 6,796
  • 4
  • 35
  • 47
OscarRyz
  • 196,001
  • 113
  • 385
  • 569
  • 5
    Ctrl+W is actually extend selection. In Eclipse it is bound to Shift+Alt+Up (Shift+Alt+Down reduces selection.) – Micke Aug 06 '09 at 17:18
0

Sorry if this is covered already, but simply having the 'changes' tab there where I can see my local changes, incoming changes, remote changes is just simply something I can't live without.. In Eclipse, I can't find such a feature!

Also just a simple thing like middle clicking which binds to the 'open declaration' is a great UI addition - something I also cannot see implemented in Eclipse.

There is only Eclipse at my work place but I'm seriously thinking of purchasing a personal Idea license....

ustad
  • 459
  • 1
  • 6
  • 21
0

In IntelliJ, one can jump through a history of the last places edited with "Last Edit Location". Eclipse has a similar feature but Eclipse only goes back to one level of edit location.

Having the history rather than just the one level that Eclipse offers is a great productivity feature: it acts as a form of auto-bookmarking, since you often want to jump back to the places where you have been making changes. I use this ability several times a day, and feel the pain of not having it when I am asked to use Eclipse for something.

TomW
  • 56
  • 2
  • That sounds more like a bug rather than an intentional limitation. – nitind Dec 04 '13 at 17:53
  • As far as I can remember, I used Alt+Left/Alt+Right in Eclipse to move back/forward between edits/views, and it had no depth limits. – Victor Jan 30 '14 at 11:21
-1

Alt+Insert to edit text in Column Mode.

0x6C38
  • 6,796
  • 4
  • 35
  • 47
alphageek
  • 770
  • 4
  • 15
-1

I not have coded a lot with IntellijIdea, but in IntellijIdea you can see where a block of code between brackets (if, try/catch, cycle, etc) begins and where finish.

In Eclipse (I code in Eclipse 3.2) you can identify the block only manually.

alepuzio
  • 1,382
  • 2
  • 28
  • 38
  • 5
    what do you mean by "manually"? In Eclipse, you have indeed to put the cursor on the { (or } ) to know where is the } (or { ). Another interesting thing is to double-click just *after* the { of a block. It will automatically select the whole { ... } block. – Romain Linsolas Feb 23 '09 at 15:59
  • In Eclipse, if you have a block very long (I see block by 100-200 lines) you must use the mouse for well see the block. IntellijIdea print a red line in left side(at least, I remember this). I think that's a more confortable with long block. – alepuzio Feb 23 '09 at 16:50
  • There's a great (free) Eclipse plugin called Java Source Helper (http://hexapixel.com/projects/sourcehelper) that shows the containing context for your location (he says the concept was taken from IDEA, btw) – Scott Stanchfield May 15 '13 at 20:14
-2

Show Navigation Bar ALT-Home.

Swapnonil Mukherjee
  • 2,312
  • 5
  • 22
  • 32