본문으로 바로가기

@PostContruct나 @PreDestroy 등 특정 Annotation에 annotation cannot be resolved 메시지가 뜰 때에는

pom.xml 에  dependency 를 하나 추가해주면 된다.

<dependency>
  <groupId>javax.annotation</groupId>
  <artifactId>javax.annotation-api</artifactId>
  <version>1.3.2</version>
</dependency>

 

간단히 해결되는 문제인데 간혹 잊어버릴 때가 있어서 정리해둔다.

 


참고자료

 

stackoverflow.com/questions/51630397/import-javax-annotation-cannot-be-resolved-in-eclipses-java-10-compiler

 

import javax.annotation.* cannot be resolved in Eclipse's Java 10 Compiler

In my machine (Windows 10), there are two versions of Java, Java 1.8 (JRE and JDK) and Java 10 (JRE and JDK). Previously IF I set my Eclipse to: Java Compiler (JDK Complience) : 1.8 Java Build Pa...

stackoverflow.com

 

반응형