Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checkstyle Error in Eclipse - Could not instantiate Tab character

Got this error today while trying to build a project with checkstyle. This works for other people in my office but I would rather not reinstall Eclipse yet again. Any idea what this error actually means?

Errors occurred during the build.
 Errors running builder 'Checkstyle Builder' on project 'myproject'.
  cannot initialize module TreeWalker - Unable to instantiate TabCharacter
  cannot initialize module TreeWalker - Unable to instantiate TabCharacter
 cannot initialize module TreeWalker - Unable to instantiate TabCharacter
 cannot initialize module TreeWalker - Unable to instantiate TabCharacter

I'm gathering that it has something to do with the tab character but not much else.

UPDATE: Version of Eclipse is 3.5, Checkstyle is 5.0.0.200906281855-final.

(Java is jdk 1.6.0_10)

like image 442
Stefan Thyberg Avatar asked Jul 31 '09 11:07

Stefan Thyberg


1 Answers

As mentioned in this bug, Checkstyle Plugin version 5.0.0.200906281855:

Release notes of Checkstyle 5 state that some of the modules and checks we are using are not backwards compatible.
E.g. the module TabCharacter does not occur in v5 any more (was replaced by FileTabCharacter), hence can't work.
The check FileLength does not require a syntax tree, hence is not any longer under parent TreeWalker.

That means your issue could be with an automatic update of the Checkstyle plugin in your eclipse configuration.

like image 164
VonC Avatar answered Oct 18 '22 13:10

VonC