类似 XXX is not accessible due to restriction on required library jre7 rt.jar 的问题

参考:http://stackoverflow.com/questions/1517619/eclipse-3-5-1-compiler-error-the-type-outputformat-is-not-accessible-due-to-res


【问题】


Java代码编译时遇到类似

protocol.https.handler is not accessible due to restriction on required library jre7/rt.jar

的编译错误


【原因】


错误检查过于严格


【解决】


Eclipse -> Window -> Preference -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API -> Forbidden reference

将级别从Error改成Warning或者Ignore


类似 XXX is not accessible due to restriction on required library jre7 rt.jar 的问题_第1张图片


你可能感兴趣的:(类似 XXX is not accessible due to restriction on required library jre7 rt.jar 的问题)