Home > Eclipse > Eclipse Tips and Shortcuts

Eclipse Tips and Shortcuts

Here is a list of the most commonly used shortcuts and tips our development team uses. I believe mastering these shortcuts help developers be more efficient in their software development.

I am always looking for more tips. If you have any tips that I am missing below please comment!!

Enjoy!!

Shortcuts

Most Common

Delete line ctrl + d
Go to Method ctrl + o
Format Code ctrl + shift + f
Last Edit ctrl + q
Line Number ctrl + l
Move line(s) alt + up/down
Open Resource ctrl + shift + r
Open Proj Prop alt + enter
Open Type ctrl + shift + t
Run Java App alt + shift + x, j
Run JUnit alt + shift + x, t
Shortcut List ctrl + shift + l

Refactoring Tips

Extract Method alt + shift + m
Extract Variable alt + shift + l
Rename alt + shift + r
Surround alt + shift + z

Templates

Go to Windows->Preferences->Java->Editor->Templates

To Activate templates press ctrl + space after command

For loop for
If statement if
Main Method main
System.out.println() sysout
System.err.println() syserr
While statement while

Custom Templates

  • Logger
    • private static final Logger logger = Logger.getLogger(${enclosing_type}.class);

Automatically Organize Imports on save

Eclipse is capable of adding imports to your classes automatically which is surely one of the most used features. The command can easily be accessed by using the appropriate keyboard shortcut. I recommend to let Eclipse automatically organize imports on save. Go to Preferences -> Java -> Editor -> Save Actions and activate Organize Imports

Categories: Eclipse Tags:
  1. Alin Popa
    November 16th, 2009 at 19:15 | #1

    Other useful (I know it speed up my work for few times) template: systrace

  2. Jochen
    November 16th, 2009 at 20:05 | #2

    You actually forgot the most useful shortcut of all times:
    Ctrl-1 (Quickfix)
    You can even use it when there is nothing to fix.

    Type new HashMap(); and hit Ctrl-1 for example.

  3. November 17th, 2009 at 07:07 | #3

    Helpful!! Thanks!~

  4. November 17th, 2009 at 08:06 | #4

    Nice! I can’t believe I missed this shortcut. Thanks for the comment!

  5. November 18th, 2009 at 10:24 | #5
  6. November 19th, 2009 at 05:34 | #6

    I would said “CTRL+T” is my favorite key, often times we need to view the class hierarchy ~

  7. November 29th, 2009 at 05:32 | #7

    Super post, Need to mark it on Digg
    Thanks
    Socco

  8. December 12th, 2009 at 13:25 | #8

    i’m gonna make my own site about it

  9. December 25th, 2009 at 08:03 | #9

    shawnkercher.com to GoogleReader!
    Dougles

  10. December 29th, 2009 at 01:01 | #10

    Thank you! I would now go on this blog every day!
    Worker

  11. May 5th, 2010 at 05:09 | #11

    Nice fill someone in on and this post helped me alot in my college assignement. Say thank you you as your information.

  12. May 18th, 2010 at 19:31 | #12

    ЎHola!
    No estб seguro de que esto es verdad:), pero gracias a un cargo.

    Worker

  13. November 21st, 2011 at 20:46 | #13

    I am earning a second degree. I would like to be a programer or network engineer for comcast. What languages are being used by Comcast to program thier set top boxes and other applications? I am currently employed by comcast but I would rather be in your job. Any words?

  1. No trackbacks yet.