Access restriction: The type XX is not API (restriction on required library 'XXX/Ja
Access restriction: The type 'XMLChar' is not API (restriction on required library '/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/rt.jar')
有时候,我们会引入rt.jar中的类来使用,比如:
com.sun.org.apache.xml.internal.utils.XMLChar
或
sun.misc.Unsafe
但是import后会飘红,报错信息如上面所示。
解决方案:
右击项目 > property > Java Build Path > remove掉JRE System Library,然后重新加入即可
还没有评论,来说两句吧...