I'm brand new to checkstyle, just trying to get a basic command line example working. I tried both the 6.12 and 6.13 jar's. I am following the instructions from here:
http://checkstyle.sourceforge.net/cmdline.html. The files google_style.xml and MyClass.java both exist and are readable. I assume the '-all' jar includes all required dependencies, isn't that what '-all' means?. If so, what's wrong?
command:
java -jar /tmp/checkstyle-6.12-all.jar -c google_style.xml MyClass.java
result:
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Unable to instantiate 'CatchParameterName' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.blocks.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.coding.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.design.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.header.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.imports.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.indentation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.javadoc.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.metrics.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.modifier.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.regexp.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.sizes.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.whitespace.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.CatchParameterName, com.puppycrawl.tools.checkstyle.filters.CatchParameterName, com.puppycrawl.tools.checkstyle.CatchParameterName. Please recheck that class name is specified as canonical name or read how to configure short name usage
http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:168)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:138)
at com.puppycrawl.tools.checkstyle.Main.runCheckstyle(Main.java:263)
at com.puppycrawl.tools.checkstyle.Main.main(Main.java:119)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'CatchParameterName' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.blocks.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.coding.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.design.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.header.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.imports.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.indentation.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.javadoc.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.metrics.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.modifier.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.regexp.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.sizes.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.whitespace.CatchParameterName, com.puppycrawl.tools.checkstyle.checks.CatchParameterName, com.puppycrawl.tools.checkstyle.filters.CatchParameterName, com.puppycrawl.tools.checkstyle.CatchParameterName. Please recheck that class name is specified as canonical name or read how to configure short name usage
http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:163)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:171)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:138)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:163)
... 3 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate 'CatchParameterNameCheck' class, it is also not possible to instantiate it as com.puppycrawl.tools.checkstyle.checks.annotation.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.blocks.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.coding.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.design.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.header.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.imports.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.indentation.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.javadoc.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.metrics.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.modifier.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.regexp.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.sizes.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.whitespace.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.checks.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.filters.CatchParameterNameCheck, com.puppycrawl.tools.checkstyle.CatchParameterNameCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage
http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly.
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:115)
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:156)
... 6 more
Checkstyle ends with 1 errors.