Checkstyle - rsanchez-wsu/jfiles GitHub Wiki

The Checkstyle plugin adds a static source code analyzer to the Eclipse IDE. The program is called "Checkstyle" for the standalone, or alternatively, "Eclipse-CS" for the Eclipse-based plugin. It is an open source development tools to check for coding standards in Java source code. Once installed, the plugin will check the code as you save each modification to the code.

You can read more about the Checkstyle program at: http://checkstyle.sourceforge.net/ or read about the Eclipse-CS Plugin at: http://eclipse-cs.sourceforge.net/

Contents

  1. Requirements
  2. Installation
  3. Usage
  4. Troubleshooting

Requirements


Installation

1) Open Eclipse. Click on the Help menu, then the Eclipse Marketplace menu item.

See image.

2) Search for Checkstyle in the search box for the Eclipse Marketplace. Make sure you choose the Eclipse-CS version from Lars Ködderitzsch. Click Install and follow the prompts. If you run into installation issues, follow the troubleshooting section.


Usage

In Eclipse, open a project. In the Package Explorer on the left-hand menu (tree view), right-click on your project and find the Checkstyle menu option. Select the Check Code with Checkstyle option. The problem markers are displayed in the source window, similar to Eclipse problem markers. Alternatively, save your code. Every save will call Checkstyle to check your code.

If you do not see the Package Explorer view, simply click on the Window menu at the top of Eclipse, choose Show View, and select Package Explorer.

View image.


Troubleshooting

Installation Troubleshooting

See image.

2a) The fastest solution would be to download the plugin as a ZIP file, then allow Eclipse to install the plugin from the ZIP file. Download the ZIP file from here (grab the latest one): https://sourceforge.net/projects/eclipse-cs/files/Eclipse%20Checkstyle%20Plug-in/

In Eclipse, head to the Help menu, then select Install New Software. In the new window, click the Add button. You will be browsing your local disk for the ZIP file you just downloaded, so click the Archive button and point the installation wizard to the ZIP file.

See image.

Follow the installation prompts, and this time Eclipse should find all of the required items for a Checkstyle plugin installation since it is not hindered by the URL it was unable to resolve through the Eclipse Marketplace.

See image.

2b) If you attempt to force your way through the installation, Eclipse may offer a you a suggested automatic solution. You may attempt it, but it may not help.

2c) Alternatively, you can manually add the repository to Eclipse. However, if the Marketplace link did not work, the repository will most likely be the same URL used by the Eclipse Marketplace.

2d) Installation issues are usually related to missing or old SSL certificates or a downed URL. To update your JDK SSL, download and install the latest JDK from this link: http://www.oracle.com/technetwork/java/javase/downloads

2e) If you are still having issues, the latest JDK you downloaded does not contain the proper SSL certificates. You may download and install them separately from this link: http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html. If none of the solutions for SSL updates, JDK updates, or manual repository entry has worked, then the server is having issues. You will have to complete this installation by manually downloading and installing from the ZIP file (step 2a).