Getting the Most from Eclipse
Last edited September 6, 2006
More by David Chandler »
Favorite Keyboard Shortcuts

Coding in Java
 
Ctrl+1 (Quick Fix) is your friend. Use it anywhere you see the red squiggles, and even when you don't. My favorite use for it is creating new methods. Simply invoke the method before you've defined it, then Ctrl+1 to automatically create the method signature.
Ctrl+Space (Auto-completion) is your next best friend. Need to loop over an array? Type "for" and hit Ctrl+Space.
Ctrl+Alt+Down Arrow (Copy Line Down). Very handy to duplicate a line. Up arrow works, too. If you find yourself doing this a lot, you might need to refactor....
Alt+Down Arrow (Move Line Down). Much faster than copy and paste.
Alt+Shift+J (Javadoc). Generates a Javadoc comment for your method or class. Use Preferences to customize your template.
Ctrl+/ (Comment Line). Also works with multiple lines.
Ctrl+Shift+F (Format Code). Select lines of code to format, then use this key to apply formatting rules defined in Preferences.
Getting around quickly
 
Ctrl+PageUp/Down cycles through editor tabs, just like Excel worksheets.
Ctrl+E brings up a list of all open files. Type the first few letters and hit Enter.
Ctrl+F7 switches between panes (views). Very useful for moving between Package Explorer and Editor.
Ctrl+F8 switches between perspectives like Java, Debug, etc.
Ctrl+Q takes you to the last edit location.
 
Split view. Click any editor tab and drag it down until you see a smaller window box, then release. Very handy for looking at related files together.
Navigating Java
 
F3 takes you to the declaration for any variable, method, class, etc. You can also hold down [Ctrl] and click to do this.
Alt+[left arrow] takes you back.
Ctrl+Shift+T brings up the Open Type dialog. Much quicker than clicking down in the package explorer.
Ctrl+Shift+R brings up the Open Resource dialog. Much quicker than clicking down in the package explorer.
Ctrl+O brings up the outline view for any class or interface. Press it again to see all inherited members.
Ctrl+T shows the type hierarchy. For an interface, it will show you all classes that implement the interface. This is extremely handy when navigation applications that separate interfaces from implementations.
Ctrl+Shift+G (Search) finds all occurrences in the workspace
Eclipse Tips & Tricks

Eclipse Special: Remote Debugging Tomcat & JBoss Apps with Eclipse @ JAVA DEVELOPER'S JOURNAL
java.sys-con.com/read/44918.htm?CFID=283168&CFTOKE...
Enable Debugging on a Remote Tomcat or JBoss Server
Limit the Number of Open Editors
Window | Preferences | General | Editors | Close editors automatically
Do Maven 1 Builds Within Eclipse
There is no Maven 1 build integration for Eclipse, but you can launch a Maven 1 build by configuring it as an external tool. Select Run | External Tools | External Tools... and create a new Program configuration as follows:
 
Location: find maven.bat on your system.
Working Directory: use the Variables button to enter ${project_loc}
Arguments: enter your maven target, like war:install
 
On the common tab, check the box to run in background and display in the External Tools menu.
 
Now you can use the Run External Tools icon to launch your maven build within Eclipse.
Launch Windows Explorer in Your Project Directory
Configure Windows Explorer as an external tool. Select Run | External Tools | External Tools... and create a new Program configuration as follows:
 
Location: C:\WINNT\explorer.exe (or alternate on your system)
Working Directory: leave blank
Arguments: use the Variables button to enter ${project_loc}
 
On the common tab, check the box to Display in Favorites Menu and click Apply and Close.
 
Now select a project in the Package Explorer and select Windows Explorer from the External Tools icon pull-down menu. Explorer should launch in your project directory.
Use a DOS Prompt Within Eclipse
Configure a DOS launcher just like Maven 1 and Windows Explorer above.
 
Location: C:\WINNT\system32\cmd.exe
Working Directory: use the Variables button to enter ${project_loc}
Arguments: none required
 
Note that DOS will launch in the Eclipse console, which is kind of weird, but sometimes handy.
Filter Your Package Explorer Views
There are several ways you can reduce the amount of "noise" in the Package Explorer View. From the pull-down menu, in the upper right corner, select Filter... to remove jar references, resources, and other things you may not need from your view. Just don't forget you have it on when you're looking for something that has disappeared.
Use Working Sets to Focus on Select Projects
Does your Package Explorer view have too many projects? From the pull-down menu in the Package Explorer View, click "Select Working Set..." to create a new working set. Select only the projects you wish to be included. You can now switch between working sets quickly from the pull-down menu.
Must-have Plugins

EclipseUML
Reverse engineer class diagrams, create sequence diagrams, and more. Outstanding.
JadClipse
Don't have the source? No problem! Use JAD (Java Decompiler right from Eclipse)
Exadel Studio
Free and professional versions for working with JSF and Hibernate. This is the only Eclipse plug-in that supports facelets. The faces-config editor is super nice.
Managing Configurations

Eclipse: Managing Multiple Eclipse ...
www.javalobby.org/java/forums/t18678.html
Yoxos - The Eclipse Distribution
www.yoxos.com/
Callisto Simultaneous Release
www.eclipse.org/projects/callisto.php
The content on this page is provided by a Google Notebook user, and Google assumes no responsibility for this content.