我正在使用Eclipse.我有以下代码行:
wr.write(new sun.misc.BASE64Encoder().encode(buf));
Run Code Online (Sandbox Code Playgroud)
Eclipse将此行标记为错误.我导入了所需的库:
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
Run Code Online (Sandbox Code Playgroud)
我使用Apache Commons作为建议的解决方案,包括:
import org.apache.commons.*;
Run Code Online (Sandbox Code Playgroud)
并导入从以下网址下载的JAR文件:http://commons.apache.org/codec/
但问题仍然存在.Eclipse仍然显示前面提到的错误; 请指教.
当我使用JDK 1.7.0在OS X上编译Spring JDBC源代码时,我收到此警告:
warning: CachedRowSetImpl is internal proprietary API and may be removed in a future release
Run Code Online (Sandbox Code Playgroud)
如何在编译期间禁止显示警告消息?
我已经知道并使用Java的@SuppressWarning注释.我正在寻找具体用法来抑制我所描述的警告.
我的问题具体是,在这行代码中:
@SuppressWarnings("valuegoeshere")
Run Code Online (Sandbox Code Playgroud)
应该用"valuegoeshere"替换什么?
编辑:人们,我知道最好避免导致警告的代码.通常这将是我的方法.但是我在这里编译第三方代码,我不想重写.我只想添加正确的注释来抑制警告,以便我可以实际做些什么的警告不会被埋没.