After importing a maven project to Eclipse Luna the following error is displayed in a pop-up when saving after modifying a method:
cannot initialize module TreeWalker - Unable to instantiate JUnitTestCase
JUnitTestCase is referring to a module in the checkstyle xml file:
<module name="JUnitTestCase"/>
I have the 'Checkstyle configuration plugin for M2Eclipse' and 'Checkstyle Plug-in 6.4.0' installed. The plugin definition for 'maven-checkstyle-plugin' in my pom file specifies version 2.10.
Note: I realise this is similar to some other questions with the same error (but a different module specified) however I am yet to find a satisfying solution. I believe that I could remove the module entry in the checkstyle config file but I require it to work as designed so that is not the preferable option.
JUnitTestCase was removed in Checkstyle 6.2 (look under "Breaking backward compatibility"). So you should either downgrade to Checkstyle 6.1.1, or remove the module reference from your checkstyle.xml.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With