Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How do I get Eclipse to run 1.6 annotation processor?
How do I get Eclipse to run 1.6 annotation processor? [message #249346] Thu, 08 November 2007 00:07 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How do I get Eclipse to run 1.6 annotation processor? [message #249351 is a reply to message #249350] Thu, 08 November 2007 06:31 Go to previous message
Eclipse UserFriend
Originally posted by: alexinbeijing.gmail.com

This did the trick. Thanks very much for your prompt and helpful answer.
Alex
Previous Topic:Beginning With JDT Plug-In Development
Next Topic:Help Viewer Error
Goto Forum:
  


Current Time: Sat Nov 09 03:35:15 GMT 2024

Powered by FUDForum. Page generated in 0.04299 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top