有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

EclipseJava。无法解析lang.annotation

我最近在Eclipse中更改了一个项目的包,这样做似乎导致了构建路径的问题

我有一个名为占位符文档的注释,如下所示

package com.projectjhs.forum.api.placeholders;

import static java.lang.annotation.ElementType.TYPE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Target(TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface PlaceholderDocumentation {
    String name();

    String description();
}

导入import static java.lang.annotation.ElementType.TYPE给出了错误The import java.lang.annotation.ElementType cannot be resolved。我在问题列表中也有一个错误

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.annotation.ElementType. Fix the build path then try building this project

我在其他任何地方都找不到与这个问题相关的任何东西

谢谢你阅读这篇文章


共 (0) 个答案