Essential Eclipse Keyboard Shortcuts for Faster Java Development
If you work in Eclipse every day, a small set of keyboard shortcuts can remove a lot of repetitive editing and navigation. Some of them are so useful that they quickly become muscle memory—especially Ctrl+1, which is still one of the most valuable commands in the IDE.
The shortcuts worth memorizing first
These are the ones that tend to make the biggest difference in daily editing:
Ctrl+1— Quick Fix. The classic Eclipse shortcut for applying suggested fixes.Ctrl+D— Delete the current line.Ctrl+Alt+↓— Copy the current line to the next line.Ctrl+Alt+↑— Copy the current line to the previous line.Alt+↓— Swap the current line with the line below it. Very handy when you want to reorder code without cut and paste.Alt+↑— Swap the current line with the line above it.Alt+←— Go to the previously edited page.Alt+→— Go to the next edited page.Alt+Enter— Show properties for the currently selected resource, such as a project or file.Shift+Enter— Insert a blank line below the current line, no matter where the cursor is on that line.Shift+Ctrl+Enter— Insert a blank line above the current line.Ctrl+Q— Jump to the last edit location.Ctrl+L— Go to a specific line. Especially useful once files get long.Ctrl+M— Maximize the current editor or view; press again to restore it.Ctrl+/— Comment the current line; press again to remove the comment.Ctrl+O— Quickly show the Outline.Ctrl+T— Show the current class inheritance hierarchy.Ctrl+W— Close the current editor.Ctrl+K— Find the next occurrence of the selected word.Ctrl+E— Show the drop-down list of currently open editors.Ctrl+/on the numeric keypad — Collapse all code in the current class.Ctrl+*on the numeric keypad — Expand all code in the current class.Ctrl+Space— Content assist for code completion. This often conflicts with input method shortcuts, soAlt+/can be used as an alternative.Ctrl+Shift+E— Open the manager for currently open views/editors so you can activate or close them.Ctrl+J— Incremental forward search. As you type, Eclipse jumps to matching text; if nothing matches, the status line shows that nothing was found.Ctrl+Shift+J— Incremental reverse search.Ctrl+Shift+F4— Close all open editors.Ctrl+Shift+X— Convert selected text to uppercase.Ctrl+Shift+Y— Convert selected text to lowercase.Ctrl+Shift+F— Format the current code.Ctrl+Shift+P— Jump to the matching bracket or symbol such as{}. Cursor position matters depending on direction.
Refactoring shortcuts used most often
Most Eclipse refactoring shortcuts begin with Alt+Shift. These are the ones that come up most often in real work:
Alt+Shift+R— Rename. One of the most useful shortcuts, especially for variables and classes.Alt+Shift+M— Extract Method. Great for breaking up large blocks of messy code.Alt+Shift+C— Change Method Signature. Useful when a method has many callers and you want the change applied consistently.Alt+Shift+L— Extract Local Variable. Good for replacing magic numbers or strings, especially when reused.Alt+Shift+F— Convert a local variable in a class into a field.Alt+Shift+I— Inline.Alt+Shift+V— Move methods or variables.Alt+Shift+Z— Undo Refactor.
Editing shortcuts
General editing
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Find and Replace</td> <td>Ctrl+F</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Find Previous</td>
<td>Ctrl+Shift+K</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Find Next</td>
<td>Ctrl+K</td>
</tr>
<tr>
<td>Global</td>
<td>Undo</td>
<td>Ctrl+Z</td>
</tr>
<tr>
<td>Global</td>
<td>Copy</td>
<td>Ctrl+C</td>
</tr>
<tr>
<td>Global</td>
<td>Restore Previous Selection</td>
<td>Alt+Shift+↓</td>
</tr>
<tr>
<td>Global</td>
<td>Cut</td>
<td>Ctrl+X</td>
</tr>
<tr>
<td>Global</td>
<td>Quick Fix</td>
<td>Ctrl1+1</td>
</tr>
<tr>
<td>Global</td>
<td>Content Assist</td>
<td>Alt+/</td>
</tr>
<tr>
<td>Global</td>
<td>Select All</td>
<td>Ctrl+A</td>
</tr>
<tr>
<td>Global</td>
<td>Delete</td>
<td>Delete</td>
</tr>
<tr>
<td>Global</td>
<td>Context Information</td>
<td>Alt+? / Alt+Shift+? / Ctrl+Shift+Space</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Show Tooltip Description</td>
<td>F2</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Select Enclosing Element</td>
<td>Alt+Shift+↑</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Select Previous Element</td>
<td>Alt+Shift+←</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Select Next Element</td>
<td>Alt+Shift+→</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Incremental Search</td>
<td>Ctrl+J</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Reverse Incremental Search</td>
<td>Ctrl+Shift+J</td>
</tr>
<tr>
<td>Global</td>
<td>Paste</td>
<td>Ctrl+V</td>
</tr>
<tr>
<td>Global</td>
<td>Redo</td>
<td>Ctrl+Y</td>
</tr>
</tbody>
</table>
View controls
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Zoom In</td> <td>Ctrl+=</td>
</tr>
<tr>
<td>Global</td>
<td>Zoom Out</td>
<td>Ctrl+-</td>
</tr>
</tbody>
</table>
Window shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Activate Editor</td> <td>F12</td>
</tr>
<tr>
<td>Global</td>
<td>Switch Editor</td>
<td>Ctrl+Shift+W</td>
</tr>
<tr>
<td>Global</td>
<td>Previous Editor</td>
<td>Ctrl+Shift+F6</td>
</tr>
<tr>
<td>Global</td>
<td>Previous View</td>
<td>Ctrl+Shift+F7</td>
</tr>
<tr>
<td>Global</td>
<td>Previous Perspective</td>
<td>Ctrl+Shift+F8</td>
</tr>
<tr>
<td>Global</td>
<td>Next Editor</td>
<td>Ctrl+F6</td>
</tr>
<tr>
<td>Global</td>
<td>Next View</td>
<td>Ctrl+F7</td>
</tr>
<tr>
<td>Global</td>
<td>Next Perspective</td>
<td>Ctrl+F8</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Show Ruler Context Menu</td>
<td>Ctrl+W</td>
</tr>
<tr>
<td>Global</td>
<td>Show View Menu</td>
<td>Ctrl+F10</td>
</tr>
<tr>
<td>Global</td>
<td>Show System Menu</td>
<td>Alt+-</td>
</tr>
</tbody>
</table>
Navigation shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Java Editor</td> <td>Open Structure</td> <td>Ctrl+F3</td>
</tr>
<tr>
<td>Global</td>
<td>Open Type</td>
<td>Ctrl+Shift+T</td>
</tr>
<tr>
<td>Global</td>
<td>Open Type Hierarchy</td>
<td>F4</td>
</tr>
<tr>
<td>Global</td>
<td>Open Declaration</td>
<td>F3</td>
</tr>
<tr>
<td>Global</td>
<td>Open External Javadoc</td>
<td>Shift+F2</td>
</tr>
<tr>
<td>Global</td>
<td>Open Resource</td>
<td>Ctrl+Shift+R</td>
</tr>
<tr>
<td>Global</td>
<td>Back in History</td>
<td>Alt+←</td>
</tr>
<tr>
<td>Global</td>
<td>Forward in History</td>
<td>Alt+→</td>
</tr>
<tr>
<td>Global</td>
<td>Previous</td>
<td>Ctrl+,</td>
</tr>
<tr>
<td>Global</td>
<td>Next</td>
<td>Ctrl+.</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Show Outline</td>
<td>Ctrl+O</td>
</tr>
<tr>
<td>Global</td>
<td>Open Type in Hierarchy</td>
<td>Ctrl+Shift+H</td>
</tr>
<tr>
<td>Global</td>
<td>Go to Matching Bracket</td>
<td>Ctrl+Shift+P</td>
</tr>
<tr>
<td>Global</td>
<td>Go to Previous Edit Location</td>
<td>Ctrl+Q</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Go to Previous Member</td>
<td>Ctrl+Shift+↑</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Go to Next Member</td>
<td>Ctrl+Shift+↓</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Go to Line</td>
<td>Ctrl+L</td>
</tr>
</tbody>
</table>
Search shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Occurrences in File</td> <td>Ctrl+Shift+U</td>
</tr>
<tr>
<td>Global</td>
<td>Open Search Dialog</td>
<td>Ctrl+H</td>
</tr>
<tr>
<td>Global</td>
<td>Declarations in Workspace</td>
<td>Ctrl+G</td>
</tr>
<tr>
<td>Global</td>
<td>References in Workspace</td>
<td>Ctrl+Shift+G</td>
</tr>
</tbody>
</table>
Text editing behavior
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Text Editor</td> <td>Toggle Overwrite Mode</td> <td>Insert</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Scroll Line Up</td>
<td>Ctrl+↑</td>
</tr>
<tr>
<td>Text Editor</td>
<td>Scroll Line Down</td>
<td>Ctrl+↓</td>
</tr>
</tbody>
</table>
File shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Save</td> <td>Ctrl+X / Ctrl+S</td>
</tr>
<tr>
<td>Global</td>
<td>Print</td>
<td>Ctrl+P</td>
</tr>
<tr>
<td>Global</td>
<td>Close</td>
<td>Ctrl+F4</td>
</tr>
<tr>
<td>Global</td>
<td>Save All</td>
<td>Ctrl+Shift+S</td>
</tr>
<tr>
<td>Global</td>
<td>Close All</td>
<td>Ctrl+Shift+F4</td>
</tr>
<tr>
<td>Global</td>
<td>Properties</td>
<td>Alt+Enter</td>
</tr>
<tr>
<td>Global</td>
<td>New</td>
<td>Ctrl+N</td>
</tr>
</tbody>
</table>
Project shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Build All</td> <td>Ctrl+B</td>
</tr>
</tbody>
</table>
Source code shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Java Editor</td> <td>Format</td> <td>Ctrl+Shift+F</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Uncomment</td>
<td>Ctrl+\</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Comment</td>
<td>Ctrl+/</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Add Import</td>
<td>Ctrl+Shift+M</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Organize Imports</td>
<td>Ctrl+Shift+O</td>
</tr>
<tr>
<td>Java Editor</td>
<td>Surround With try/catch</td>
<td>Not set by default</td>
</tr>
</tbody>
</table>
For wrapping code in a try/catch, there is no default shortcut listed here, but it is used often enough that setting one yourself is worth considering. In many cases, Ctrl+1 can also apply this automatically through Quick Fix.
Run and debug shortcuts
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Step Return</td> <td>F7</td>
</tr>
<tr>
<td>Global</td>
<td>Step Over</td>
<td>F6</td>
</tr>
<tr>
<td>Global</td>
<td>Step Into</td>
<td>F5</td>
</tr>
<tr>
<td>Global</td>
<td>Step Into Selection</td>
<td>Ctrl+F5</td>
</tr>
<tr>
<td>Global</td>
<td>Debug Last Launched</td>
<td>F11</td>
</tr>
<tr>
<td>Global</td>
<td>Resume</td>
<td>F8</td>
</tr>
<tr>
<td>Global</td>
<td>Step with Filters</td>
<td>Shift+F5</td>
</tr>
<tr>
<td>Global</td>
<td>Toggle Breakpoint</td>
<td>Ctrl+Shift+B</td>
</tr>
<tr>
<td>Global</td>
<td>Display</td>
<td>Ctrl+D</td>
</tr>
<tr>
<td>Global</td>
<td>Run Last Launched</td>
<td>Ctrl+F11</td>
</tr>
<tr>
<td>Global</td>
<td>Run to Line</td>
<td>Ctrl+R</td>
</tr>
<tr>
<td>Global</td>
<td>Execute</td>
<td>Ctrl+U</td>
</tr>
</tbody>
</table>
Refactoring reference table
<table> <thead> <tr> <th>Scope</th> <th>Action</th> <th>Shortcut</th> </tr> </thead> <tbody> <tr> <td>Global</td> <td>Undo Refactor</td> <td>Alt+Shift+Z</td>
</tr>
<tr>
<td>Global</td>
<td>Extract Method</td>
<td>Alt+Shift+M</td>
</tr>
<tr>
<td>Global</td>
<td>Extract Local Variable</td>
<td>Alt+Shift+L</td>
</tr>
<tr>
<td>Global</td>
<td>Inline</td>
<td>Alt+Shift+I</td>
</tr>
<tr>
<td>Global</td>
<td>Move</td>
<td>Alt+Shift+V</td>
</tr>
<tr>
<td>Global</td>
<td>Rename</td>
<td>Alt+Shift+R</td>
</tr>
<tr>
<td>Global</td>
<td>Redo</td>
<td>Alt+Shift+Y</td>
</tr>
</tbody>
</table>
If you only pick a handful to start with, Ctrl+1, Ctrl+D, Alt+↑/↓, Ctrl+L, Ctrl+Shift+F, Ctrl+O, and Alt+Shift+R will already make Eclipse feel much faster.