This content has been marked as final. Show 6 replies
did the annotation mechanism change significantly between 5 and 6 that would account for this?I'm fairly sure the API for 5 (JSR 175) is quite a bit different to 6 (JSR 269).
Java 5 was all in the sun name space (something one should never use according to Sun), in Java 6 parts of it get rejigged and moved into javax.
Edited by: mlk on 21-Nov-2008 16:28
PeteFord wrote:If you have apt annotation processors, you can use the apt command in JDK 6.
I've been trying to use a package of annotations and processors that was evidently originally designed to be used with "apt" and Java 5. When I try to use this stuff with Java 6 I was assuming that, since the Java 6 javac handles annotations, I could just use javac instead of apt - but it doesn't work; the annotation processors don't appear to be getting executed. It looks like I have to use apt for the Java 6 build after all.
The question is, did the annotation mechanism change significantly between 5 and 6 that would account for this? Is there a way to adapt an annotation package (i.e. annotation classes and processors) that works with 5 so that it will work with 6 using javac instead of apt (or alternatively, is there a way to tell javac to process the older annotations in the same way that apt would)?
However, the javac in JDK 6 support standardized JSR 269 annotation processing; see the javax.annotation.processing package. JSR 269 annotation processing is significantly redesigned and improved based on experiences with apt.
It would be "a small matter of programming" to port an apt annotation processor to JSR 269.
Using apt in JDK 6, you can also run both apt and javac processors from a single command line invocation.
The apt annotation processors in question are supplied as part of a third-party package, so I can't modify them (well actually we have the sources so technically we could, but there's little point). No matter; the point is that the package was intended to be used with apt and so I can set up my build to do it that way - it should work just fine.
The responses here explain what I'm seeing and answer my question - thanks, all.
I was running into the same issue, glad you asked it Pete.
[hypnotize someone blog|http://theartofcoverthypnosis.com/]
I blocked the spam.