
Introduction
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.
Checkstyle is highly configurable and can be made to support almost any coding standard. An example configuration files are supplied supporting the Sun Code Conventions, Google Java Style.
Installation Steps
In order to configure and activate check style in your eclipse you need check style plugin installed in your eclipse. You can check check style plugin in your eclipse using window -> preferences option from the top of the menu.
Type checkStyle in the text area and you will find checkStyle option below in the screen. checkStyle already Installed in my eclipse and now project specific CheckStyle can be configure.
CheckStyle Plugin installation steps involve installation of plugin on your eclipse so project specific checkStyle can be uploaded.
Please find the steps below –
Step 1: You can install the Checkstyle Eclipse plugin using Eclipse update manager from the following links
http://eclipse-cs.sourceforge.net/update
Step 2: Navigate to Help option from the top menu and click on Install New Software, please find the option in below screenshot
Step 3: Click on Add button to add above url to download and install plugin in your eclipse. Complete Name and Location information and click on OK button.
Step 4: Once Url added it will start showing CheckStyle package to install in your eclipse as below given screenshot. please click on Next button and complete the installation.
Step 5: Above steps helped us to install checkStyle Plugins in eclipse, Now click onWindow and then Preferences to configure project specific CheckStyle.
Step 6: Click on New button to configure CheckStyle. Check style configuration page will display.
Step 7: Complete CheckStyle Configuration Page as per above screen and Browse CheckStyle file from your system and click on OK button.
Step 8: After Clicking on OK button above screen display and project specific CheckStyle configured in eclipse. We need to click on Set As Default to make this CheckStyle as default.
After Clicking on Set As Default button project specific CheckStyle will be default.
Step 9: Click on OK button to complete the configuration. It will show confirmation window, please click on yes.
Step 10: To execute CheckStyle please right click on Java File and Navigate toCheckstyle -> Check Code with checkStyle option.
Step 11: Click on Check Code with checkstyle with give you checkstyle report.
CheckStyle File Download Link: Click on below to download checkstyle file.