问题描述
File file = new File(filePath);
【实际】filePath: xxx/test.PNG
【代码】filePathe: xxx/test.png
Windows 运行程序时没有报错,在Linux中运行程序时报错如下:
报错:xxx/test.png 不存在。
原因分析
Windows对文件名称、文件类型的大小写不敏感。
Linux对大小写敏感(文件名称、文件类型)
File file = new File(filePath);
【实际】filePath: xxx/test.PNG
【代码】filePathe: xxx/test.png
Windows 运行程序时没有报错,在Linux中运行程序时报错如下:
报错:xxx/test.png 不存在。
Windows对文件名称、文件类型的大小写不敏感。
Linux对大小写敏感(文件名称、文件类型)