Access restriction type XmlRootElement not accessible

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

Access restriction type XmlRootElement not accessible

 

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…

Access restriction type XmlRootElement not accessible

 

Now click Java Build Path and change execution environment to Alternate JRE then click Finish then OK as below:

Access restriction type XmlRootElement not accessible

Access restriction type XmlRootElement not accessible

This should fix the issue.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *