【发布时间】:2013-04-17 19:11:25
【问题描述】:
当我尝试在 java 中读取 excel 文件时出现以下错误,尽管该文件存在。我在Windows环境中。我已确认该文件存在于该位置。
java.io.FileNotFoundException: D:\myfile.xls (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at jxl.Workbook.getWorkbook(Workbook.java:213)
我的代码如下:
wb = Workbook.getWorkbook(new File("D:/myfile.xls"));
【问题讨论】:
-
请确保您创建的文件中文件名和扩展名的大小写。
标签: java