Installing


You can download checkstyle from sourceforge. After downloading, unzip the file, and the only file you need is "checkstyle-all-4.2.jar" The zipped file is also filled with some very good documentation that will teach you how to set up your style checker.

Setting Up


Checkstyle uses an XML file to determine the rules to check your style by. The documentation in the ZIP file can explain how to set up your file. Our groups checkstyle configuration can be found here.

How to Run


You can use the following line to run checkstyle from the command line. (You could alternatively add the checkstyle jar to your classpath)

java -cp checkstyle-all-4.2.jar com.puppycrawl.tools.checkstyle.Main -c checkStyleConfig.xml *.java

There is also an option in NetBeans to run checkstyle during compile, so that you can check your code directly from the IDE. This will speed up the process of fixing stylistic errors, just as a debugger speeds up error fixing in your code.

AStyle


To speed up style fixes even more. Check out "astyle" on Sourceforge. It can be used to fix style errors like spacing and tabs, so that you don't have to manually edit all of the code.