Reputation: 2109
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?
Upvotes: 3
Views: 3235
Reputation: 269687
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.
Upvotes: 7