Mounting an old project on a fresh install of Eclipse I got a few errors regarding access restriction to some methods and types from Sun's java 6 library.
Description Resource Path Location Type
Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not accessible due to restriction on required library /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/rt.jar ImageCaptchaServlet.java «path» line 43 Java Problem
Description Resource Path Location Type
Access restriction: The method encode(BufferedImage) from the type JPEGImageEncoder is not accessible due to restriction on required library /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/rt.jar ImageCaptchaServlet.java «path» line 45 Java Problem
Description Resource Path Location Type
Access restriction: The type JPEGCodec is not accessible due to restriction on required library /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/rt.jar ImageCaptchaServlet.java «path» line 16 Java Problem
Description Resource Path Location Type
Access restriction: The type JPEGImageEncoder is not accessible due to restriction on required library /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/rt.jar ImageCaptchaServlet.java «path» line 17 Java Problem
This situation can be solved as follows:
1 - Goto to the Java Compiler section of the Project Properties dialog and then Errors and Warnings.
2 - Check Enable project specific settings
3 - Inside Deprecated and restricted API change the Forbidden reference (acess rule) to Warning or Ignore
13 comments:
Thank you. I had a similar error. And your solution helped.
Thank you! That solve it!
Hi,
Thanks a lot. It helped me to change the error to warning.
I think it is wrong to disable warnings without understanding what they means. Probably problem or these warnings is wrong execution enviroments configuration. How to configure execution enviroment is described in http://www.arunasu.lt/en/java/warning-rt-jar
Thank u very much!!!!!!!!
Thanks you a lot! my problem was resolved!
Thank you! My problem was resolved!
I do not think if it is a solution. The problem will exist but you will not get any warning about it. Often it is caused by execution enviroment mix up.
Possible solution:
Project build path settings -> Libraries tab -> select JRE System Library -> Edit button -> change from Execution Environment radio tab which says J2SE 1.x (jdk1.6.0_21) to Workspace default JRE (jdk1.6.0_21).
I apologize for my English!
@arunasu
Thanks for the link you posted. I was able to resolve this error using that link.
@arunasu
Thanks for the link you posted. I was able to resolve this error using that link.
Muchisimas gracias, funciono perfectamente
Gracias, muchas gracias
Thanks!
Post a Comment