无法阻止 ant 生成编译器 Sun 专有 API 警告 [英] Cannot stop ant from generating compiler Sun proprietary API warnings

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

问题描述

我从我的 ant 脚本中调用 javac,如下所示:

I call javac from my ant script like this:

<javac srcdir="src" 
   destdir="build/classes" source="1.6" 
   target="1.6" debug="true" encoding="Cp1252"
   nowarn="true"> 

但它仍然在输出中抛出编译器警告:

But it still throws compiler warnings in the output:

[javac] Compiling 73 source files to C:\IKOfficeRoot\Java\ERP\Framework\build\classes

[javac] C:\IKOfficeRoot\Java\ERP\Framework\src\de\ikoffice\util\LoggerFactory.java:49: warning: sun.reflect.Reflection is Sun proprietary API and may be removed in a future release
[javac]         return Logger.getLogger(Reflection.getCallerClass(2));
[javac]                                 ^
[javac] Note: C:\IKOfficeRoot\Java\ERP\Framework\src\de\ikoffice\db\SingleShotResultSet.java uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 warning

我也试过

<compilerarg line="-Xlint:-unchecked -Xlint:-deprecation"/>

<compilerarg value="-Xlint:none"/>

但这也没有效果.如何删除警告?

but this has no effect either. How to I remove the warnings?

推荐答案

-XDignore.symbol.file 选项添加到 javac 命令行对我有用.

adding the -XDignore.symbol.file option to the javac command line worked for me.

这篇关于无法阻止 ant 生成编译器 Sun 专有 API 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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