This is an old revision of the document!


The Checkstyle Plugin for Eclipse

Checkstyle is a static analysis tool. The Checkstyle plugin for Eclipse enables the use of Checkstyle from within Eclipse .

Installation - Fall 2018 Special Instructions

The normal Checkstyle installation process is not working reliably at the moment (circa 9/5/2018). However, it is possible to install version 8.11 “manually”. To do so, in a WWW browser, go to:

v8.11 Download Site

then right-click on the link named net.sf.eclipsecs-updatesite_8.11.0.201807281521.zip (underneath the word “Downloads”) and save the .zip file to a convenient location.

Now start Eclipse and click on Help+Install New Software. When the dialog box opens, click on Add…. When the new dialog box opens, click on Archive…, navigate to the .zip file that you saved earlier, and click on OK. Then click on Add on the previous dialog. To actually start the installation process, on the previous dialog select Checkstyle and click on Next or Finish.

Installation

The easiest way to install the Eclipse Checkstyle Plugin is as follows.

  1. Start a WWW browser and navigate to http://eclipse-cs.sourceforge.net/ .
  2. Start Eclipse.
  3. Drag the “Install” icon from the WWW browser into a running Eclipse workspace.
  4. When the dialog box appears, check “Checkstyle Plug-in” and click on Confirm.
  5. Check “I accept…” and click on Finish.
  6. If you get a message about “unsigned content”, click OK.
  7. Restart Eclipse.

Several alternative methods are discussed at the Checkstyle Plugin site .

Enabling the Checkstyle Plugin

To enable the Checkstyle plugin for a particular project:

  1. Right-click on the project.
  2. Click on Checkstyle and Activate Checkstyle. (Or, if there is no Checkstyle entry, click on Properties and then select “Checkstyle”, check “Checkstyle active…” and click on OK.)

Loading a Checks File

If your course uses a custom checks file:

  1. Download the file to an appropriate location on your local file system.
  2. In Eclipse, right-click on the project, and pull down to Properties.
  3. Select “Checkstyle” and click on the “Local Check Configurations” tab.
  4. Click on New.
  5. Select “External Configuration File”, enter a “Name:” and the “Location:” of the file, and click OK.
  6. Select the “Main” tab.
  7. Select the appropriate configuration file from the drop-down list.
  8. Click on OK.
  9. When the “Rebuild suggested” dialog appears, click on Yes.