Search code examples
javajspservletsjdbcannotations

The import javax.annotation.Resource cannot be resolved


I have tried to resolve by adding missing/unnecessary jar's but nothing works for me. if you know how to resolve this issue then kindly help... Thank you in advance.

Code IDE ERROR

I am using JDK 9.0.4 installed in this IDE Eclipse 4.7 Oxygen December 2017

Windows 10

Servlet 4.0

JSP 2.3

JSTL tags


Solution

  • Eclipse is facing some bugs in IDE 4.7 it is not fully compitable with JDK 9 like in with JDK 9 IDE is not generating toString() function also...

    so i change the JDK 9 to jdk 8.1 and it solves all the problem.

    to change the JDK...

    Window > Preferences > Installed JREs >>> Change the JDK 9 to JDK xx
    

    AND/OR

    Right Click Project > Properties > JRE > Edit >>> YOUR ALTERNATIVE JDK xx
    

    This had solved my problem.