Access restriction: The type XX is not API (restriction on required library 'XXX/Ja

阳光穿透心脏的1/2处 2022-06-05 11:21 519阅读 0赞
  1. 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,然后重新加入即可

发表评论

表情:
评论列表 (有 0 条评论,519人围观)

还没有评论,来说两句吧...

相关阅读