Search This Blog

Eclipse: Access restriction: The method createJPEGEncoder(OutputStream) from the type JPEGCodec is not accessible due to restriction on required library

Imported some source code in a Eclipse java project, and got error:

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.24/jre/lib/rt.jar

The fix it:

  1. Right-click the project, and click "Properties"
  2. open "Java Compiler", 
  3. select "Errors/Warnings",
  4. "Enable project specific settings", 
  5. open "Deprecated and restricted API"
  6. change to "Warning" for "Forbidden reference(access rules)"

1 comment: