How do I get Eclipse to run 1.6 annotation processor? [message #249346] |
Thu, 08 November 2007 00:07 |
Eclipse User |
|
|
|
Originally posted by: alexinbeijing.gmail.com
Hi,
I am sure the answer to this question is very simple but I can't figure
out what it is. Here is my situation:
1. Running a brand new download of Eclipse 3.3, using JRE 1.6.0_03-b05.
2. "Compiler compliance" set to 6.0 in project properties.
3. I have a JAR with an annotation processor in it, which subclasses from
AbstractProcessor.
4. I go into project properties, Java Compiler -> Annotation Processing
and select "Enable Annotation Processing".
5. Go into Java Compiler -> Annotation Processing -> Factory Path and add
the JAR with the JSR 269 annotation processor in it.
6. Click on "Advanced...", and no processors are displayed in the
"Advanced Options" dialog.
How can I get Eclipse to "see" my annotation processor?
Thanks, Alex
|
|
|
Re: How do I get Eclipse to run 1.6 annotation processor? [message #249348 is a reply to message #249346] |
Thu, 08 November 2007 00:29 |
Eclipse User |
|
|
|
Originally posted by: wharley.bea.com
"Alex Dowad" <alexinbeijing@gmail.com> wrote in message
news:b2cf8ac773749ed14abaf48bfa9921d6$1@www.eclipse.org...
>
> Hi,
>
> I am sure the answer to this question is very simple but I can't figure
> out what it is. Here is my situation:
>
> 1. Running a brand new download of Eclipse 3.3, using JRE 1.6.0_03-b05.
> 2. "Compiler compliance" set to 6.0 in project properties.
> 3. I have a JAR with an annotation processor in it, which subclasses from
> AbstractProcessor.
> 4. I go into project properties, Java Compiler -> Annotation Processing
> and select "Enable Annotation Processing".
> 5. Go into Java Compiler -> Annotation Processing -> Factory Path and add
> the JAR with the JSR 269 annotation processor in it.
> 6. Click on "Advanced...", and no processors are displayed in the
> "Advanced Options" dialog.
>
> How can I get Eclipse to "see" my annotation processor?
Do you have a META-INF/services entry?
|
|
|
Re: How do I get Eclipse to run 1.6 annotation processor? [message #249350 is a reply to message #249348] |
Thu, 08 November 2007 00:42 |
Eclipse User |
|
|
|
Originally posted by: wharley.bea.com
"Walter Harley" <wharley@bea.com> wrote in message
news:fgtla5$j6v$1@build.eclipse.org...
> Do you have a META-INF/services entry?
Sorry, I guess I could be a bit less cryptic than that :-)
Processors are declared either in an extension (for plug-ins containing
processors) or in a file in the META-INF/services folder (for a jar), or
both (for plug-ins that also want to be compatible with javac).
The META-INF/services file follows the general protocol for such files: the
file must have the name of the interface being implemented, and then contain
a line of text that is the name of the implementation class (or multiple
such lines, if there are multiple implementations).
In this case, the file would be
META-INF/services/javax.annotation.processing.Processor, and the contents
would be something like:
# A comment, prefixed by the hash symbol
org.xyz.processors.MyFirstProcessor
org.xyz.processors.SomeOtherProcessor
|
|
|
|
Powered by
FUDForum. Page generated in 0.04299 seconds