Access restriction type XmlRootElement not accessible
Today while working on java code with XML annotation to process as an XML object I saw below issue:
Access restriction: The type XmlRootElement is not accessible due to restriction on required library C:\Program Files\Java\jdk1.7.0_65\jre\lib\rt.jar
Solution: This was happening due to multiple jar which contains the same class file. To fix it: Right click project –> Build Path –> Configure Build Path…
Now click Java Build Path and change execution environment to Alternate JRE then click Finish then OK as below:
This should fix the issue.