JAVA

class is not accessible due to restriction error 해결

ndlessrain 2012. 7. 29. 20:30
728x90

import sun.misc.BASE64Decoder;

import sun.misc.BASE64Encoder;

를 사용하려고 하는데 다음과 같은 메시지가 이클립스에 나오는데... 해결책을 찾아보니

Sun 내부함수라고 쓰지 말라고 하네요. 필요하면 아래와 같이 사용해보는것도 방법인듯 싶네요.

Access restriction: The type BASE64Encoder is not accessible due to restriction on required library.

Access restriction: The type BASE64Decoder is not accessible due to restriction on required library.

[Eclipse] Access restriction: Class is not accessible due to restriction on required library

해결책

이클립스의 환경설정의 변경을 통해서 임시로 해결을 할 수 있습니다.

Windows -> Preferences -> Java -> Compiler -> Errors/Warnings

(프로젝트) Properties -> Java Compiler -> Errors/Warnings

 

Forbidden reference (access rules) 를 Warning 으로 변경해줍니다.

 

 

728x90