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
Requirements
-
Eclipse: Eclipse IDE will be our recommended development environment for this project. Download Eclipse at this link: https://www.eclipse.org/downloads/
-
JDK: A Java Development Kit of 1.5.0 or later is required. You most likely have this installed from a previous class. Otherwise, head here to download and install the latest version: http://www.oracle.com/technetwork/java/javase/downloads/index.html.
Installation
1) Open Eclipse. Click on the Help
menu, then the Eclipse Marketplace
menu item.
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
.
Troubleshooting
Installation Troubleshooting
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.
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.
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).