Tutorial

Eclipse Shortcuts

Published on August 3, 2022
Default avatar

By Pankaj

Eclipse Shortcuts

While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.

Eclipse is one of the most widely used IDE for Java developers. I have been using it for more than 10 years and there are so many shortcuts that can help you in development by saving time.

Eclipse Shortcuts

I am using Eclipse on Mac and Windows system. Here I am providing the most widely used Eclipse shortcut commands. Note that these shortcuts are for Eclipse Juno, so some of them might not work for other Eclipse versions.

Shortcut Key Mac Shortcut Key Windows Description
Command + 3 Ctrl + 3 It puts the focus into Quick Access search box.
Command + S Ctrl + S Save current editor
Command + 1 Ctrl + 1 Quickfix for errors and warnings, depends on the cursor position
Control + Space Ctrl + Space Content assist and code completion
Command + Shift + F Ctrl + Shift + F Format source code
Control + Q Ctrl + Q Moves cursor to the last edited position
Command + D Ctrl + D Deletes current line in the editor
Command + Shift + O Ctrl + Shift + O Organize imports in the current java file
Command + 2 + L Ctrl +2 + L Assign statement to new local variable
Command + 2 + F Ctrl + 2 + F Assign statement to a field
Command + O Ctrl + O Shows quick outline of the java class
Command + fn + F11 Ctrl + F11 Runs the current opened java class if main method exists or else run the last launched application
Command + Shift + R Ctrl + Shift + R Open / Search for resources
Command + Shift + T Ctrl + Shift + T Open / Search for types, very useful in finding classes
Command + E Ctrl + E To select an editor from the currently open editors
Command + fn + F8 Ctrl + F8 Shortcut for switching perspectives
Command + [ or Command + ] Alt + ← or Alt + → Go to previous/ next editor position in history
Fn + F3 F3 Move cursor to the declaration of the variable
Command + Shift + P Ctrl + Shift + P Move cursor to the matching bracket
Command + . Ctrl + . Go to the next problem
Command + Shift + . Ctrl + , Go to the previous problem
Fn + F4 F4 Show type hierarchy of the variable
Command + K Ctrl + K Find next for search text in the opened editor
Command + Shift + G Ctrl + Shift + G Search for references in the workspace
Command + T Ctrl + T Shows type hierarchy of the current java class
Command + M Ctrl + M Maximize Java editor
Fn + Shift + F2 Shift + F2 Shows the javadoc of the method, class
Command + Option + R Alt + Shift + R Rename of package, class etc
Command + Option + T Alt + Shift + T Opens the quick refactoring menu

These are the most useful eclipse shortcuts that I use every day to save time. If you know any other shortcuts please let us know through comments.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about us


About the authors
Default avatar
Pankaj

author

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
JournalDev
DigitalOcean Employee
DigitalOcean Employee badge
May 24, 2016

Here are some I use frequently that aren’t listed, although the refactoring items are available from the refactoring menu shown when you use Alt + Shift + T, but it requires an additional mouse click if you go that route. Refactoring: Alt + Shift + L - Extract highlighted expression to local variable. Alt + Shift + I - Inline highlighted variable (inverse of Alt + Shift + L) Alt + Shift + M - Extract method. Expression Selection (useful in combination with the extract/inline features): Alt + Shift + Up Arrow - Widens current selection to cover the next largest expression either highlighted or where the cursor is located. Alt + Shift + Down Arrow - Narrows current selection to cover the next smallest expression highlighted. Source: Alt + Shift + S - Source menu (provides options for implementing getters/setters, etc). Equivalent to selecting Source from the menu bar, but you don’t have to click, and you can use arrow keys +enter to select an option)

- Dave V.

    JournalDev
    DigitalOcean Employee
    DigitalOcean Employee badge
    July 9, 2014

    Ctrl+Shift+L

    - mani

      JournalDev
      DigitalOcean Employee
      DigitalOcean Employee badge
      July 4, 2013

      It’s hard to come by well-informed people about this topic, but you sound like you know what you’re talking about! Thanks

      - free tips on how to win the lottery similar web-site

        Try DigitalOcean for free

        Click below to sign up and get $200 of credit to try our products over 60 days!

        Sign up

        Join the Tech Talk
        Success! Thank you! Please check your email for further details.

        Please complete your information!

        Get our biweekly newsletter

        Sign up for Infrastructure as a Newsletter.

        Hollie's Hub for Good

        Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

        Become a contributor

        Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

        Welcome to the developer cloud

        DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

        Learn more
        DigitalOcean Cloud Control Panel