如何禁止关于Sun专有API的java编译器警告 [英] How can I suppress java compiler warnings about Sun proprietary API

查看:188
本文介绍了如何禁止关于Sun专有API的java编译器警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sun.misc.BASE64Encoder包中的encode()方法。如何禁止它生成的编译器警告?


sun.misc.BASE64Encoder是Sun专有的API,可能会在


作为跟进,为什么我在Eclipse中看不到这个警告?

解决方案

您可以切换到不同的Base64实现,例如 http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html ,这是Apache公共包的一部分,您可能已经将其包含在类路径中,或 http://iharder.sourceforge.net/当前/ java / base64 / ,如果您不想在路径上再另一个Jar,那么您可以执行它并粘贴在源代码树中。


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?

解决方案

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编译器警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆