I am quite new to IntelliJ being a Eclipse user for many years, so I really find this error where all annotations expect for the @Override
are showing error "not applicable to type"
E.g the @PostConstruct
annotation from JBoss Errai is showing this errors all around, where the import is there with no error at all.
How do I fix this?
Update:
E.g
@PostConstruct // When hovered with the mouse pointer '@PostContruct' is not applicable to method
public void init() {
}
Screenshot: http://snag.gy/q5cW5.jpg
Looking at the definition, one sees @Target
mentioning method.
So you might have imported a totally different PostConstruct annotation.
Inspect the imports / go to the definition in IntelliJ.
package javax.annotation;
@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface PostConstruct
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With