I have the same request as this one:
My situation is like this:
- we have a build machine which is used to build all our projects
- this build machine uses Ant and JDK 1.4 for building the projects
- some projects are compiled with JDK 1.4 and some are compiled with JDK 1.5
When I check the sources of a project which was compiled with JDK 1.5, I get the following error on some checks: java.lang.UnsupportedClassVersionError: (Unsupported major.minor version 49.0)
This is caused because Ant is running on a JDK 1.4 and therefor cannot read the classes compiled with JDK 1.5.
What I need is something similar like the junit task has: a fork and jvm attribute. These attributes make it possible to tell checkstyle to run in a JDK1.5 JVM.
If you think this could be interesting, I'll try to produce a patch.