Accepted answer

my most commonly used features are

ctrl+1 quick-fix / spell-checker

opening files

  • ctrl+shift+t load class file by classname
  • ctrl+shift+r load any file by filename

matches are made on the start of the class/filename. start your search pattern with a * to search anywhere within the filename/classname.


  • ctrl+shift+f format source file (set up your formatting style in window | preferences | java | code style | formatter)
  • ctrl+shift+o organise imports

generated code

  • alt+s,r to generate getters and setters
  • alt+s,v to insert method signatures for overidden methods from superclass or interface


  • alt+shift+l extract text-selection as local variable (really handy in that it determines and inserts the type for you.
  • alt+shift+m extract text-selection as a method
  • alt+shift+i inline selected method

running and debugging.

alt+shift+x is a really handy prefix to run stuff in your current file.

  • alt+shift+x, t run unit tests in current file
  • alt+shift+x, j run main in current file
  • alt+shift+x, r run on server

there are more. the options are shown to you in the lower-right popup after hitting alt+shift+x.

alt+shift+x can be switched for alt+shift+d in all the above examples to run in the debugger.


as of the recent ganymede release, you can now switch of validation in specified files and folders. i've been waiting for this feature for ages.

  • go to project | properties | validation
  • click on the ... button in the settings column of the validator you want to shut up
  • add a rule to the exclude group

code navigation

  • hold down ctrl to make all variables, methods and classnames hyperlinks to their definitions.
  • alt+left to navigate back to where you clicked ctrl
  • alt+right to go "forwards" again


i find the project-specific settings useful in eclipse 3.3.

for example, if you have several developers working on a project who have different code styles for curly braces, line spacing, number of imports etc. then you can specify the style settings for the project. then you can configure the save actions so that the code is automatically formatted when a file is saved. the result is everyone's code is formatted the same before it's checked in.


i use a lot of the above and also like for quick search: ctrl+j then type what i am looking for, then ctrl+k for next occurrence.


shift+alt+b for the simple navigation row over the editor.


lately i've been using the mousefeeds plugin to automatically tell me what the key stroke combinations are. that way by repetition i remember them better.

this link has a better picture and description of what it looks like and does.


i've just released this blog post about top 5 useful hidden eclipse features. it contains:

  1. favorites: types and members that will always show up in auto-completion
  2. the awesome block selection mode: for multi-line editing
  3. the egit staging view: much better than git itself
  4. type filters: to remove awt and java.lang.object stuff from auto-completion
  5. formatter tags: to delimit code sections that shouldn't be auto-formatted


alt+left and alt+ right will navigate you forward and back.


i am also a fan of eclipse, however since i spend a majority of my time in visual studio, i will suggest that you read eric sink's series of articles "c# to java" (parts 1-4). not only is eric always an entertaining read, but this brief series covers some awesome eclipse insight for those who have not been into eclipse or have been away from it for a while:

from c# to java: part 1
from c# to java: part 2
from c# to java: part 3
from c# to java: part 4


ctrl-shift-m while the cursor is on a class name in your java file, will specifically add that and only that class to your imports. this is different from ctrl-shift-o which will not only add those imports not already defined, but will also remove imports not currently needed, something you might not necessarily want to do.

i forgot about [ctrl+2 -> r] scope variable rename. place the cursor in the variable you wish to rename, press ctrl+2, then r, then type the new name watching all instances of that variable get renamed at the same time.

it's awesome at refactoring hungarian notation.


alt-shift-a is extremely useful in a few situations.


a lot of the key bindings depend on the perspective and view currently active.

my most used ones for the java perspective:

  • ctrl-shift-r open resource
  • ctrl-shift-t open type
  • ctrl-1 quick fix/refactor
  • ctrl-j incremental search
  • ctrl-h search in files (select a base directory and set scope to selected resources)
  • ctrl-o list methods
  • ctrl-alt-h open call hierarchy
  • ctrl-shift-l list shortcut keys
  • hit ctrl-shift-l again to go directly to preferences to change key mappings


i'd like to add two additional shortcuts:

  • ctrl+f6 switch between open editors (ctrl+shift+f6 to scroll through the list in the opposite direction)

  • ctrl+f11 start program in debug mode

  • f11 start program in normal mode


  • ctrl+shift+x selected text becomes uppercase

  • ctrl+shift+y selected text becomes lowercase


one key feature: shift+alt+t for the refactoring menu.


  • ctrl-shift-t, but only type the initial characters (and even a few more) of the class you're looking for. for example, you can type "netli" to find networklistener
  • in the search window, ctrl-. takes you to the first leaf of a tree branch
  • alt-/ is word completion. slightly different from ctrl-space


ctrl+shift+p to jump to the matching bracket/parenthesis.


local history

it's a great feature. eclipse has its own mini-cvs for all files in a project. if you want to revert some change you made, or even restore deleted file - you can right click on the project and select "restore from local history".

just saved my ass *tears of joy*


eclipse auto refresh isn't on by default so if you make changes to a file outside of eclipse, the change won't be reflected in your build. this is very annoying if you just did an svn/git update/rebase and things aren't working the way they're supposed to.

turn it on in windows->preferences->workspace and tick refresh automatically.


ctrl+page down / ctrl+page up to switch between opened editors

ctrl+e to also switch between opened editors (allows to type the name)

ctrl+o is extremely important for me. you don't longer need the outline view then (you can close it which will give you more space). then, you can type a method name or just the beginning of it and you quickly can get to it. i also use it to inspect what stuff is available. for example: ctrl+o and then type get ... now i see all getters.

f3 while an element is selected in the code: brings you to its definition or it's source. e.g. used on a method call it brings you into the source code of that method.

ctrl+m to maximize the current window

as already said, ctrl+3 is extremely good. it basically allows you to use eclipse completely without a mouse. just type ctrl+3 and then package explorer for example.

ctrl+f8 cycle trough perspectives

ctrl+l allows to type a line number and brings you directly to that line.

ctrl+shift+g searches for all references to the selected element in the workspace.

and not a shortcut: in the project settings under java editor you can find save actions. this allows you to set up the project so that the code is automatically cleaned up and formatted when you save a file. that's very good it safes you from constantly pressing ctrl+o and ctrl+f.


ctrl-alt (up/down) copy selected line(s) above or below current line.
alt (up/down) move current (or multiple selected) lines up or down
ctrl-shift-r bring up the resource window, start typing to find class/resource
ctrl-o bring up all methods and fields for the current class. hitting it again will bring up all methods and fields for current class and super classes.
ctrl-/ or ctrl-alt-c comment single or multiple lines with //
ctrl-shift-/ comment selected lines with /* */
ctrl-. take you to the next error or warning line


in terms of actual features, rather than shortcuts, i strongly recommend taking a look at mylyn.

it essentially skins eclipse with a task focussed view. it tracks the files you touch when working on a task, and focusses many aspects of the ui onto the resources that it decides are relevant to the job in hand. eclipse can be somewhat busy to look at, especially with a big multi module project, and mylyn helps cut through the cruft. the connectivity to issue tracking software and source control repositories is also excellent.

in my experience, it polarises opinion amongst those who try working with it, which is probably a sign that it is offering something interesting... don't mean to sound like a fanboy - it is definitely worth a look though.


a shortcut that i use everyday is ctrl+k. in your editor (not only java file), simply select a text (like a variable, a function, etc.), and then use this shortcut to go to the next occurrence of this text in the current editor. it's faster than using the ctrl+f shortcut...

note also that you can use ctrl+shift+k to search backwards.


this is cool: if someone has emailed you a stack trace, you can copy and paste the stack trace into eclipse's console window. you can then click on class names in the stack trace as if your own code had generated it.

Related Query

More Query from same tag