已弃用的编译错误 [英] Deprecated compiling error

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

问题描述

我正在尝试编译我的 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 使用或覆盖已弃用的 API.使用 Xlint-deprecation 重新编译以获取详细信息.

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天全站免登陆