If you receive an error message similar to the below, this article might be of interest for you.

1
Access restriction: The type 'CharacterEscapeHandler' is not API (restriction on required library 'C:\Program Files\Java\jdk1.7.0_25\jre\lib\rt.jar')

The error indicated that a Java internal class you are importing is actually a non API class. This means the class is only used by Java itself, but should not be used by other classes implemented in Java as Oracle does not guarantee that the class will not change by time with a newer Java version. Thus it is in general a bad design choice to use such classes and you should implement it yourself.

Internal / Non API classes can easily be identified by their package path. All classes, which reside in the package com.sun. are non API classes.

In my example I was using the following class in a XML parser.

1
import com.sun.xml.internal.bind.marshaller.CharacterEscapeHandler;

Since my solution is only temporary I ignored this and found a way to ignore this error message in Eclipse as found on stackoverflow.com.

http://stackoverflow.com/questions/860187/access-restriction-on-class-due-to-restriction-on-required-library-rt-jar

1
2
3
Go to the Build Path settings in the project properties.
Remove the JRE System Library
Add it back; Select "Add Library" and select the JRE System Library. The default worked for me.

 Hope it helps.