Eclipse Checkstyle Tutorial

Eclipse Checkstyle Tutorial explains step by step details of installing and configuring Checkstyle plugin with eclipse.

What is Checkstyle?

How to configure Checkstyle plugin with eclipse?

Checkstyle is a free source code analysis tool helps to improve your code quality by checking with certain pre-configured standards.

Checkstyle is also available as a command line tool. If you have a different IDE other than Eclipse, plug-ins available for Netbeans, IntelliJ IDEA & etc.

Note

If you interested on PMD Eclipse Plugin (another source code analysis tool), You can follow PMD Eclipse Tutorial

If you interested on Findbugs Eclipse Plugin (another source code analysis tool), You can follow Findbugs Eclipse Tutorial

If you interested on Sonar Eclipse Plugin (another source code analysis tool), You can follow Eclipse Sonar Tutorial

Checkstyle Tutorial

You need to download

  1. Eclipse 3.7
  2. Checkstyle 5.6

You can install the Checkstyle Eclipse plugin using Eclipse update manager from the following links

  1. http://eclipse-cs.sourceforge.net/update

Checkstyle Installation

For Installing Checkstyle Plugin from eclipse, select Help->Install New Software Then click add, then provide Name and Location according to the following screenshot

Checkstyle Installation

Then select the Checkstyle version click next and accept the license details, it will install the Checkstyle

Checkstyle Configuration

After install, you can configure Checkstyle from eclipse, Window->Preferences->Java->Checkstyle

Checkstyle Configuration

Using Checkstyle Plugin

You need to create a java project and add some class into src

Now, Build the project using Project->Build Project. Right click on the project, and run the Checkstyle according to following screenshot.

Running Checkstyle

Now you can see a bug mark on the source code, Checkstyle violations will be shown ( You can also navigate to Window->Show View->Other->Checkstyle->Checkstyle violations).

From Checkstyle violations tab, You can get more detailed description about this bug(See the below screenshot).

Checkstyle Vroperties











1 Responses to "Eclipse Checkstyle Tutorial"
  1. baskar 2013-08-02 10:45:11.0

Your email address will not be published. Required fields are marked *