title: import javax.annotation.* cannot be resolved in Eclipse's Java 10 Compiler
body: <p>In my machine (Windows 10), there are two versions of Java, Java 1.8 (JRE and JDK) and Java 10 (JRE and JDK).</p>
  
  <p>Previously <strong>IF</strong> I set my <strong>Eclipse</strong> to:</p>
  
  <ul>
  <li>Java Compiler (JDK Complience) <strong>: 1.8</strong></li>
  <li>Java Build Path (JRE System Libraries) <strong>: 1.8</strong></li>
  </ul>
  
  <p><strong>THEN IF</strong> i use following Spring code</p>
  
  <pre><code>import javax.annotation.PostConstruct;
  ...
  ...
  ...
  @PostConstruct
  ...
  ...
  </code></pre>
  
  <p>Everything works <strong>fine</strong>. No error at all.</p>
  
  <p><strong>However</strong>, IF I set my Eclipse to:</p>
  
  <ul>
  <li>Java Compiler (JDK Complience) <strong>: 10</strong></li>
  <li>Java Build Path (JRE System Libraries) <strong>: 10</strong></li>
  </ul>
  
  <p>Now, the <code>import</code> statement is <strong>throwing an Error message:</strong></p>
  
  <pre><code>The import javax.annotation.PostConstruct cannot be resolved
  </code></pre>
  
  <p>and this <strong>error also happen</strong> on <code>@PreDestroy</code> annotation too.</p>
  
  <p>Why is this happening? What happen to Java 10? How to solve this problem if i still want to retain Java Compiler and JRE System Libraries version to Java 10?</p>
  
  <p>Thank You.</p>