[Solved] Annotation Customize Error: ElementType cannot be resolved to a variable

In the development process, you may use custom annotations (this article uses custom annotations when using JWT) to report an error:

ElementType cannot be resolved to a variable

Manually import packages:

import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.ElementType;

Perfect solution

Read More: