Compilation error for annotations in Java 1.8 and IntelliJ IDEA 14
You need to configure a separate annotation profile for your module.
- Create an annotation profile
- In the Annotation Processors page, click .
- In the 'Create new profile' dialog box, specify the profile name.
- Associate a module with an annotation profile
- Configure annotation processing for a profile
-
Enable annotation processing for the
default
profile. - Disable annotation processing for the profile, you've just created.
-
Enable annotation processing for the
This answer is based on an article from IntelliJ IDEA Help.
naXa stands with Ukraine
#BelarusWithUkraine 🤍❤️🤍 🇺🇦 I focus mostly on java technologies such as spring-framework, android, hibernate, gradle, etc. Employment history: Exadel, ScienceSoft, self-employed. Feel free to consider all code I provide on Stack Overflow licensed under CC0, I would be happy to receive an "honourable mention" or something, but for the code it's optional.
Updated on June 28, 2022Comments
-
naXa stands with Ukraine almost 2 years
I was playing with Java annotation processing. Application build fails in IntelliJ IDEA, while a maven build ends successfully. I am sure that provider class exists, yet I get the following error:
java: Bad service configuration file, or exception thrown while constructing Processor object: javax.annotation.processing.Processor: Provider <my class> not found.
I suppose that's because of a module
X
, that should be compiled with-proc:none
argument. But I need annotation processing to be enabled for the rest of application. How to configure IntelliJ IDEA build proccess to skip a specific module during annotation proccessing? -
naXa stands with Ukraine over 7 years@maytham-ɯɐɥʇʎɐɯ IDK. The screenshot is copied from IntelliJ IDEA Help.
-
kriegaex over 7 yearsWhy do you a) answer your own question, b) answer it the very same minute you posted it and c) put a bounty on it more than a year later? I am puzzled.