Eclipse
Introduction
This page is dedicated to using and learning about the Eclipse IDE.
Getting Started
- Recommended Reading - A great introduction article written by Chris Aniszczyk on IBM developerWorks.
- Visit the Eclipse Packaging Project (EPP) page and download the Eclipse IDE for Java EE Developers. This will give you most of what you need to deal with web servers, JavaScript, XML, etc.
Settings
Here are few settings that I like to configure for my workspace which might be useful for others:
- Installed JREs - Make sure your JRE settings are configured to point to the correct JDK that you want to compile code against. By default, Eclipse picks up whatever you have on your path or in your registry which might be the JRE used by your web browser. To configure, go to Window->Preferences->Java->Installed JREs. For example:

- Execution Environments - Now that the Installed JREs are configured it is time to associate them with their corresponding execution environments. For example:


Execution environments are important as they can be assigned to Java projects which, in turn, allow the Java projects to be easily shared in a team environment. This is possible because the .classpath for each project will reference the execution environment instead of a specifically named JRE which, in the past, would cause CVS/SVN synchronization problems. - User Libraries - Can be found via the Windows->Preferences->Java->Build Path->User Libraries dialog. It is here that you can create your own custom library set. In my case, I named them Application Libraries but you can call yours whatever you like. This is useful because I can define one custom library set which I can add to my project(s) classpath(s) so all dependancies are easily resolved when compiling code. Screenshot:

- Code Style - Adjust the Window->Preferences->Java->Code Style settings so that comments are automatically added for new methods and types as shown here:

This ensures that the code template settings mentioned below always get set. - Code Template (right-click to download) - You can import the settings via the Window->Preferences->Java->Code Style->Code Templates dialog. Screenshot:

…and here is a video demonstration (13 seconds, 160KB). - Task Tag - Found via Window->Preferences->Java->Compiler->Task Tags. Screenshot:

Just another way in which to fine tune the tasks I need to complete when writing code. These tasks, once defined in code, will show up in the Eclipse Tasks view as shown here (found via Window->Show View->Tasks):

- Javadoc - This can be set via the Window->Preferences->Java->Compiler->Javadoc dialog. Screenshot:

I pretty much turn everything on to ensure I have the most verbose Javadoc output. Generating detailed Javadoc is not only useful for others but for my own sake as well. - File Associations - By default, batch files will execute when double-clicking on them. This can be changed via Window->Preferences->General->Editors->File Associations. Screenshot:

Plugins
The following is a list of additional plugins worth checking out and installing:
- Aptana - Aids in HTML, CSS, and Javascript development amongst other things. You might think about studying the Grease Monkey Scripting as well.
- SubEclipse - Adds Subversion code repository support to Eclipse. Use the update site to download and install the feature.
- Eclipse Shell - Building upon the aspects of Aptana (mentioned above), this will allow you to use dynamic languages to create Java classes.
- ANT Explorer - Enables one to visual ANT property and build files. Use the update site to download and install this feature.
- yDoc - Adds UML diagrams to your Javadoc by simply passing additional options on the command line. For example:
-umlautogen -umlstyle theBlues -docletpathC:/apps/java/ydoc-2.2_03-jdk1.5/lib/ydoc.jar;C:/apps/java/ydoc-2.2_03-jdk1.5/lib/class2svg.jar;C:/apps/java/ydoc-2.2_03-jdk1.5/resources -doclet ydoc.doclets.YStandard

- JSEclipse - Adds JavaScript editing support to Eclipse.
- PDT - Enables PHP development. Use the PDT Update Site for quick and easy install of the plug-in.
- EPIC - Enables you to code and debug for the Perl language.
- CSS Designer - Provides CSS development support. The cost is $19.95, however, there is a 30-day trial version.
- LogWatcher - Enables Eclipse to tail logs.
For a list of additional plugins, visit the Eclipse Plugins web site.
Tips & Tricks
The following demonstrate a few useful tips and tricks for making the most of Eclipse:
- Running a Java application with the -verbose:class program argument will yield a console dump of all classes being loaded (in addition to JAR files) before the class is run. Reference.
- Using Eclipse Efficiently.
- String Prompt (50 seconds, 536KB) - This is a quick demonstration of the “string prompt” variable that is one of many variables available in Eclipse. This demonstration shows that it is not always necessary to edit your program arguments but rather let Eclipse prompt you for them. This demonstration uses a simple password encryption program that prompts you for a password that should be encrypted. Once the password is accepted, the console windows shows the resulting, encrypted, output.
- Hidden CVS Branches - In some situations it is difficult to find a branch that you know exists. You switch to the CVS perspective, select a repository, right-click on the Branches icon, and select “Refresh Branches…” but the branch you are looking for does not appear. Well, here is how to correct that issue:
- Click on the HEAD branch.
- Right-click on the project that you know exists in the branch you are trying to find.
- Right-click on the project and select “Configure Branches and Versions…”. Example:

- You will then get a dialog like this:

- Following the numbers shown in the dialog above, you start by browsing for a file (any file should do), select all tags that appear in the right-most window, click on the “Select All” button (highlighted in yellow0, click the “Add Checked Tags” button (highlighted in yellow), and finally hit the OK.
- Go back to the Branches view and you should now see the branch that was previously hidden.
- Eclipse RCP: Tips and Tricks
Resources
- Eclipse Help - The Eclipse online help system.
- Improving code with Eclipse plugins.
Sub-Pages
Search
Categories
- Adventures
(112)
- Announcements
(36)
- Business
(19)
- Electronics
(21)
- Epicurean
(10)
- Games
(3)
- Literature
(1)
- Mechanical
(4)
- Meetups
(18)
- Movies
(2)
- Music
(26)
- Photography
(1)
- Services
(27)
- Software
(132)