Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 649
Muhammad Siddique Avatar asked Feb 27 '18 20:02

Muhammad Siddique


2 Answers

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.

like image 69
Muhammad Siddique Avatar answered Sep 20 '22 00:09

Muhammad Siddique


I have encountered the same problem with you.
Download javax.annotation.jar online and add to your library may help.

like image 21
Evan-Gao Avatar answered Sep 21 '22 00:09

Evan-Gao