| Java, Eclipse and Web programming Tutorials |
Version 0.5
Copyright © 2008 - 2009 Lars Vogel
03.08.2009
| Revision History | ||
|---|---|---|
| Revision 0.1 | 18.03.2008 | Lars Vogel |
| Findbugs | ||
| Revision 0.2 | 18.05.2008 | Lars Vogel |
| Checkstyle | ||
| Revision 0.3 | 16.07.2009 | Lars Vogel |
| updated installation of Findbugs, new screenshots | ||
| Revision 0.4 | 21.07.2009 | Lars Vogel |
| update installation description to checkstyle | ||
| Revision 0.5 | 03.08.2009 | Lars Vogel |
| own article for checkstyle | ||
Table of Contents
Checkstyle checks if the Java code is according to certain standards hence ensuring a certain quality of the coding.
Checkstyle is a tool to help ensuring that your Java code adheres to a set of coding standards
http://eclipse-cs.sourceforge.net/update Update site for the Eclipse Checkstyle Plugin.
Please see Eclipse Update Manager for more information on how to use the update manager.
If you developing with Eclipse, make sure to select the Sun Conventions (Eclipse) under Window -> Preferences -> Checkstyle. Press the "Set as Default" after selecting the right entry.

You can turn of certain checks. If you change settings from the standard profile you should always make a copy of the existing profile.
To customizine your check, first make a copy of the checks

Select your new configuration and press Configure. De-activate for example the checks for Javadoc Comments.

Make this new setting your default one.
For teams it is good to follow the same coding style rules.
The Eclipse checkstyle plugin allows this by proving a remote site for the checkstyle settings.
Press new in the settings. Select "Remote Configuration". Give the rule set a description and then type in the URL you want to use for the settings.

Make this new setting your default one.
Make your new profile the default one.
You need to activate the Eclipse Checkstyle Plugin for your project. Right click on your project and search for Checkstyle. Select the checkbox "Checkstyle active for this project".

You can use the checkstyle browser view to display the violations.

Thank you for practicing with this tutorial.
Please note that I maintain this website in my private time. If you like the information I'm providing please help me by donating.For questions and discussion around this article please use the www.vogella.de Google Group. Also if you note an error in this article please post the error and if possible the correction to the Group.
I believe the following is a very good guideline for asking questions in general and also for the Google group How To Ask Questions The Smart Way.
http://www.vogella.de/articles/EclipseCodeAnalysis/download/checkstyletemplate.xml My personal Checkstyle settings for Eclipse Plugin Development