问题描述
我正在使用sun.misc.BASE64Encoder包中的encode()方法。如何禁止它生成的编译器警告?作为跟进,为什么我在Eclipse中看不到这个警告?
您可以切换到不同的Base64实现,例如,这是Apache公共包的一部分,您可能已经将其包含在类路径中,或,如果您不想在路径上再另一个Jar,那么您可以执行它并粘贴在源代码树中。
I'm using the encode() method from the sun.misc.BASE64Encoder package. How do I suppress the compiler warnings that it generates?
And as a followup, why don't I see this warning in Eclipse?
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.
这篇关于如何禁止关于Sun专有API的java编译器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!