自定义注解提示:RetentionPolicy/ElementType cannot be resolved to a variable

在开发excle的通用导入导出功能,用到注解,报如下错误,包导入不进来

RetentionPolicy cannot be resolved to a variable

ElementType cannot be resolved to a variable

@Retention和@Target都能导入进来,没办法只能手动导入包了

import java.lang.annotation.*

import java.lang.annotation.RetentionPolicy;

import java.lang.annotation.ElementType;

这样,RetentionPolicy/ElementType cannot be resolved to a variable问题就解决了

如若转载,请注明出处:http://www.codingwhy.com/view/851.html

你可能感兴趣的:(java)