Search code examples
javaeclipseapibase64sun

How can I suppress java compiler warnings about Sun proprietary API


I'm using the encode() method from the sun.misc.BASE64Encoder package. How do I suppress the compiler warnings that it generates?

sun.misc.BASE64Encoder is Sun proprietary API and may be removed in

And as a followup, why don't I see this warning in Eclipse?


Solution

  • You could switch to a different Base64 implementation, e.g., http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html which is part of the Apache commons packages, which you might already have included in your classpath, or http://iharder.sourceforge.net/current/java/base64/ which you could just take the implementation and stick in your source tree if you don't want another Jar on the path.