views:

115

answers:

2

I'm working on some imaging applications from a book my professor gave me. The book's from 2001 and Eclipse is telling me on some of the lines things like "Access Restriction: the type JPEGImageEncoder is not accessible due to restriction on a required library /usr/lib/jvm/java-6-openjdk/jre/lib/rt.jar".

I know I can suppress these warning, but will that cause other problems?

+1  A: 

I think this is more related to eclipse than to Java itself.

See if the content in this article helps you.

from the article

It says you can just change the level of the message so you can continue. It may be what you need. Give it a try and let us know.

OscarRyz
Thanks very much, but I already found that article. I'm really looking for an explanation as to what a restricted library is. Despite my best efforts, I can't seem to find out why some libraries are restricted and some aren't.
crazedgremlin
@crazedgremlin: Makes sense.
OscarRyz
+4  A: 

These warnings are a feature of Eclipse, and are not generally pertinent to Java.

The warnings are there because the API you are using is not guaranteed to be supported by all Java implementations (like Harmony, or IBM), or even to be present in a future version of the Oracle implementation.

Relying on these APIs risks a NoSuchMethodError or ClassDefNotFoundError at runtime.

erickson
Thanks very much, that's exactly what I was looking for!
crazedgremlin