How to add shortcut keys for java code in eclipse

The feature is called "code templates" in Eclipse. You can add templates with:

Window->Preferences->Java->Editor->Templates.

Two good articles:

  • Don't write the code, generate it
  • Custom Templates

Also, this SO question:

  • Useful Eclipse Java Code Templates

System.out.println() is already mapped to sysout, so you may save time by learning a few of the existing templates first.


Type "Sysout" and then Ctrl+Space. It expands to

System.out.println();