如何使用-Xlint编译:unchecked? [英] How do I compile with -Xlint:unchecked?
本文介绍了如何使用-Xlint编译:unchecked?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在编译代码时收到一条消息:
I'm getting a message when I compile my code:
Note: H:\Project2\MyGui2.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
如何使用 -Xlint:unchecked重新编译
推荐答案
在命令行上为javac指定:
Specify it on the command line for javac:
javac -Xlint:未选中
javac -Xlint:unchecked
或者如果您使用Ant修改javac目标
Or if you are using Ant modify your javac target
<javac ...>
<compilerarg value="-Xlint"/>
</javac>
如果您使用Maven,请在 maven-compiler-plugin
If you are using Maven, configure this in the maven-compiler-plugin
<compilerArgument>-Xlint:unchecked</compilerArgument>
这篇关于如何使用-Xlint编译:unchecked?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文