1

I recently changed the package of a project in Eclipse, and doing this appears to have caused problems with the build path.

I have an annotation called PlaceholderDocumentation, seen below

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();
}

The import import static java.lang.annotation.ElementType.TYPE gives me the error The import java.lang.annotation.ElementType cannot be resolved. I also have an error in the Problems list that says

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

I haven't been able to find anything related to this issue anywhere else.

Thank you for reading this.

TheJavaCoder
  • 11
  • 1
  • 5
  • This works fine for me in the current Eclipse and Java without any problems. Can you reproduce it in the current Eclipse and Java in a new project (might be something with your dependencies)? – howlger Mar 05 '21 at 17:00
  • @howlger I created a new project, and I still got the errors above. – TheJavaCoder Mar 05 '21 at 21:39
  • Have you tried with the current Eclipse without additional plugins? If so, your Java installation is broken. – howlger Mar 06 '21 at 08:19

0 Answers0