Access restriction错误解决方案

eclipse里遇到以下问题

工程引用了 import com.sun.org.apache.bcel.internal.ExceptionConstants;

提示错误: Access restriction: The type ExceptionConstants is not accessible due to restriction on required library /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar

解决方案:
Prefrence -- Java -- Compiler -- Error/Warnings -- Deprecated and restricted API

修改Forbidden reference(access rules) 的选项,改成warning或ignore,即可解决编译问题


参考:
http://www.mkyong.com/java/access-restriction-the-type-base64encoder-is-not-accessible-due-to-restriction/

你可能感兴趣的:(eclipse)