Installing the Eclipse IDE at Home

Last updated: Mar 27, 2012


Tool Recommended Version for CSE 421
Java J2SE JDK 1.7 (aka 7.0), current patch is 03
Eclipse IDE 3.7.2 (aka Indigo)
JUnit 4.8 (included with Eclipse)
FindBugs 2.0.0
Checkstyle 5.5

Installing Eclipse at home is fairly easy, despite the paucity of installation instructions easily available from the Eclipse web site. Installation requires four steps:

  1. Downloading a JDK
  2. Downloading Eclipse
  3. Launching Eclipse
  4. Installing plugins

Each of these steps is described below. Please read through these directions completely before beginning the installation.

There are screencasts available that illustrate this process here. These screencasts show how to install (and configure) the JDK, Eclipse, and various plugins. These screencasts illustrate the general steps, but this page is the definitive guide on which plugins to install and how to configure them.

Step 1: Downloading Java Development Kit (aka J2SE JDK)

  1. Follow this link for the download page of the recommended JDK (7.0).
  2. Find the download for only the JDK (no NetBeans or EE or bundles) and click "Download".
  3. Choose the link corresponding to your OS and accept the license.
  4. Run the installer, accepting all the defaults including the installation locations.

On a Windows machine, following these steps will create a subdirectory of C:\Program Files\Java which contains the JDK installation (eg C:\Program Files\Java\jdk1.7.0_03). You may have other subdirectories of C:\Program Files\Java corresponding to other JDKs or JREs that were previously installed. Do not remove these other Java installations if they exist.

On a Mac, you already have the most recent version of Java (assuming you are keeping your machine updated) so you don't need to do anything for this step.

Step 2: Downloading Eclipse

  1. Go to http://www.eclipse.org/downloads/ and click on the link corresponding to your OS next to "Eclipse IDE for Java Developers".
  2. Pick a mirror site, and the download of a zip file begins.
  3. Extract the zip file. On Windows, you can right-click and "Extract All...". On Linux or Mac, you can use a terminal window to gunzip and then tar -xf the downloaded file. The extraction results in a directory containing a single subdirectory called "eclipse".
  4. Move and rename this eclipse subdirectory to an appropriate location on your hard disk. For Windows, I suggest renaming this eclipse subdirectory to C:\Eclipse\v3.7.2-Indigo In particular, you should avoid putting it somewhere with spaces in the path (for example, somewhere under C:\Program Files). For Mac, you can drag the executable to the Applications folder.
  5. You might find it useful to create a shortcut to the eclipse.exe executable and then put this shortcut on your desktop.

Step 3: Launching Eclipse for the First Time

  1. Run the Eclipse executable and choose a directory when prompted for a workspace. (Accepting the default is fine.)
  2. Go to workbench by selecting the appropriate large icon. (You can always get back to this welcome screen later, with Help > Welcome, and take a look at the tutorials and samples available through the other icons.)
  3. Check that the following configurations are properly set. These settings are available under Windows > Preferences on a Windows machine and under Eclipse > Preferences on a Mac.
    • Java > Installed JREs, ensure that the recommended JRE version (ie jre1.7.0_03) is listed and selected. If it is not (eg Eclipse chooses the most recent JRE it finds installed on your machine, which may be a more recent JRE version than the recommended one), click "Add" and browse to your JRE directory (under JDK installation directory in step 1 above) and click OK.
    • Java > Installed JREs > Edit > Default VM Arguments, add -enableassertions (or -ea for short).
    • Java > Compiler, the "Compiler Compliance Level" should be set to the same version as the recommended JRE (ie 1.7).
    • Install/Update > Automatic Updates, select "Automatically find new updates and notify me".

Step 4: Installing Plugins

General advice:

  1. Always use the Update Manager, as described in the steps below. (Many plugins can also be installed by downloading a zip and extracting it in your Eclipse installation directory. This is a bad idea.)
  2. Make sure Eclipse is installed in a location that does not have spaces in the path. (C:\Program Files\Eclipse can be a bad choice. Using C:\Eclipse\v3.7.2-Indigo, for example, is a safer bet.)

Each plugin is installed separately. Some plugins are part of the main Eclipse project, while others come from an independent third party. Installing a plugin involves following these steps:

  1. Help > Install New Software... find the update site for the plugin being installed. If the update site is from a third party and not available in the drop-down list, it needs to be added by clicking the "Add..." button and entering the appropriate URL (see below)
  2. Expand the tree below the update site and select the appropriate plugin(s), then click "Install..."
  3. Accept the licence and click Finish
  4. Restart Eclipse

Follow the steps given above for each plugin listed below:

Plugin FindBugs
Update Site http://findbugs.cs.umd.edu/eclipse/
Installation Notes FindBugs appears to be sensitive to Eclipse being installed in a location that contains spaces in the path. If selecting a feature to install generates an error like "Current configuration problems", try moving the Eclipse installation directory somewhere without spaces in the path.
Configuration Notes
Usage Notes You can run FindBugs manually by right-clicking on a project, then selecting FindBugs from the context menu. Alternatively, you can setup FindBugs to run automatically, every time a file is modified: Right-click on a project, Properties > FindBugs, then select "Run FindBugs automatically". Note that this setting is project-specific, so it has to be repeated for each project individually.
Plugin Checkstyle
Update Site http://eclipse-cs.sourceforge.net/update
Installation Notes There are multiple versions of Checkstyle and of the corresponding plugins. To avoid problems you should only install version 5.5. When selecting what to install, expand the "Eclipse Checkstyle Plug-in" entry and select only the "Eclipse Checkstyle Plug-in" 5.5 subentry. Do not install anything else from this particular update site.
Configuration Notes The checking configuration used by Checkstyle should be set to conform to coding practices in this class. Go to Window > Preferences > Checkstyle, and create a new "Remote Configuration", using the following location: http://www.cse.ohio-state.edu/~bucci/421/resources/cse421Style.xml Make sure you set this configuration as the default before you close the Checkstyle preferences dialog. Aside: This configuration file is just the "Sun Checks (Eclipse)" built-in configuration with the following warnings disabled/modified:
  1. Javadoc Comments > Package Javadoc (disabled)
  2. Javadoc Comments > Type Javadoc > allowUnknownTags (enabled)
  3. Size Violations > Maximum Line Length (changed trigger-point of warning from 80 to 90)
  4. Blocks > Avoid Nested Blocks > allowInSwitchCase (enabled)
  5. Coding Problems > Hidden Field (disabled)
  6. Miscellaneous > Final Parameters (disabled)
  7. Miscellaneous > New line At End Of File (enabled)
  8. Miscellaneous > New line At End Of File > lineSeparator (changed from 'system' to 'lf', the Unix-style line separator)
Usage Notes You can run Checkstyle manually or automatically (ie every time a file is modified). Both options are available by right-clicking on a project, then selecting Checkstyle from the context menu. If Checkstyle complains about files not ending with new-lines, you are probably running on Windows but have end-of-line delimeters set to Unix (see Windows > Preferences > General > Workspace). While forcing newlines to be Unix is good practice for sharing code with other team members, it seems to confuse Checkstyle. You can either ignore this Checkstyle warning, or change your preferences to use your OS's new line characters.