Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#198 java.lang.NoSuchFieldError

release_3.1
closed
Oliver Burn
5
2012-10-10
2004-01-16
Tommy Hunt
No

I execute the following commands...however the reports
contain one kind of error many, many times...

C:\java\checkstyle-3.1>java -
Dbasedir=C:/java/checkstyle-3.1/docs com.puppycrawl
.tools.checkstyle.Main -c C:\java\checkstyle-3.1
\docs\sun_checks.xml -f plain -o
C:\tmp\sun_checks.txt -r
Z:\ngshared\java\src\com\harris\netboss\shared\model\d
os\

C:\java\checkstyle-3.1>java -Dindent.severity=warning -
Dtranslation.severity=err
or -Dcheckstyle.header.file=C:\java\checkstyle-3.1
\docs\java.header com.puppycra
wl.tools.checkstyle.Main -c C:\java\checkstyle-3.1
\docs\checkstyle_checks.xml -f
plain -o C:\tmp\checkstyle_checks.txt -r
Z:\ngshared\java\src\com\harris\netbos
s\shared\model\dos\

The reports contain this error for every single source file
in the tree....

Z:\ngshared\java\src\com\harris\netboss\shared\model\d
os\PluggableCommand.java:0: Got an exception -
java.lang.NoSuchFieldError: tokenTypeToASTClassMap

What am I doing wrong?

Discussion

  • Lars Kühne
    Lars Kühne
    2004-01-17

    Logged In: YES
    user_id=401384

    This is most certainly caused by having an incorrect version
    of Checkstyle or ANTLR in your classpath.

    Please set your CLASSPATH to be empty and then execute

    java
    -jar c:\java\checkstyle-3.1\checkstyle-all-3.1.jar
    -c C:\java\checkstyle-3.1\docs\sun_checks.xml
    -f plain
    -o C:\tmp\sun_checks.txt
    -r Z:\ngshared\java\src\com\harris\netboss\shared\model\dos\

    (all in one line of course)

    BTW:
    1) basedir is meant to be the basedir of your source files
    (in your case Z:\ngshared\java\src), not the checkstyle
    installation directory
    2) You may want to upgrade to version 3.3, which contains
    many enhancements and bugfixes, see the releasenotes on our
    web site