您的位置:首页 > 编程语言 > Java开发

[Eclipse问题]A class file was not written. The project may be inconsistent

2016-02-03 11:05 549 查看
在学习过程中,有时在编写Java的类时,会遇到:A class file was not written. The project may be inconsistent, if so try refreshing this project and building it 这样的问题。

这是因为有些名称在Windows下面都不能创建。注意,不许分大小写。Con,con,CON 都不可以!

con是操作系统保留的一个设备名字,还有很多设备名都不能拿来用,如下:

The following reserved device names cannot be used as the name of a file: CON, PRN, AUX, CLOCK$, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension (for example, NUL.tx7).

所以在遇到类似问题时要重新查看一下自己的类名是否发生了冲突,如果冲突,将类名改为合适的再编译一下就可通过了。

学习之原文【/article/11355835.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: