对不起这个愚蠢的问题。但我真的无法找到我做错的地方。请帮忙。我正在尝试使用 JSON 解析文件。文件也存在于系统中。但它显示 filenotfound 异常。这真的很令人沮丧。
我的代码片段如下:
System.out.println("Please provide JSON file path : ");
filePathJson = "\"D:\\files\\test.xlsx\"";
//in.nextLine();
System.out.println("Please provide Excel file path : ");
filePathExcel = in.nextLine();
Object obj = parser.parse(new FileReader(filePathJson));
System.out.println("hii");
JSONArray array = new JSONArray();
我得到的错误:
Please provide JSON file path :
Please provide Excel file path :
"D:\\files\\test1.xlsx"
java.io.FileNotFoundException: "D:\files\test.xlsx" (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at java.io.FileInputStream.<init>(FileInputStream.java:96)
at java.io.FileReader.<init>(FileReader.java:58)
at JavaJsonSplitter.main(JavaJsonSplitter.java:50)
有人可以指出我做错了什么。
请忽略一个无用的系统输出。