Checkstyle Home Page

Checkstyle Logo





Hosted by: SourceForge Logo


Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard.

By default it supports the Sun Code Conventions. However, Checkstyle is highly configurable.

A good example of a report that can be produced using Checkstyle and Maven can be seen here.


The things that Checkstyle can check for are:


The latest release of Checkstyle can be downloaded from the SourceForge download page.

If you want to live on the bleeding edge, you can checkout the current development code from CVS and compile yourself.

Upgrading to release 2.4

As of release 2.4 Checkstyle can only be configured by properties. The major impact is to the ANT task as many arguments have been removed. It is still possible to customise Checkstyle via ANT task, but the technique has changed. For example the following call with Checkstyle 2.3:

    <checkstyle cacheFile="target/checkstyle.cache"
      <fileset dir="src" includes="**/*.java"/>

has the equivalent call with Checkstyle 2.4:

    <checkstyle properties="dev/checkstyle.config">
      <fileset dir="src" includes="**/*.java"/>
      <property key="checkstyle.cache.file"
      <property key="checkstyle.header.file"

See the documentation for the ANT Task for more examples.

Related Tools

Checkstyle is most useful if you integrate it in your build process or your development environment. The distribution includes:

  • An Ant task.
  • A command line tool.


If you have written a plugin for other IDEs, like VisualCafé, please let us know, so we can provide a link here.

Copyright © 2001 Oliver Burn. All rights Reserved.