What does a "restricted library" really mean in Java?
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?
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.
I think this is more related to eclipse than to Java itself.
See if the content in this article helps you.
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.
链接地址: http://www.djcxy.com/p/12818.html