不推荐的编译错误 [英] Deprecated compiling error

查看:117
本文介绍了不推荐的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译我的Java程序,但是我收到了弃用文件错误。

I'm trying to compile my Java program, however I am getting a "Deprecated File" error.

我通常通过键入Javac FileName.java来编译该文件,但是我收到一条错误消息:

I normally compile the file by typing "Javac FileName.java", however I get an error saying:


FileName.java使用或覆盖depreacted API。
使用Xlint弃用重新编译以获取详细信息。

FileName.java uses or overrides a depreacted API. Recompile with Xlint-deprecation for details.

我在命令行输入什么内容才能使其运行?

What do I type into the command line to make it run?

推荐答案

这不是错误,只是警告

编译器仍将生成一个类文件,您将能够运行它。但是,处理警告是个好主意,因为使用弃用的API可能会在以后导致更多问题。

The compiler will still produce a class file and you will be able to run it. However, it's a good idea to address the warning, since using deprecated API could lead to more problems later on.

如果您选择查看警告,则可以执行此操作:

If you choose to see the warnings, you can do this:

javac -Xlint:deprecation FileName.java

这篇关于不推荐的编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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