有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java内容未反映在eclipse资源文件夹的输出文件中

我使用下面的代码将输出写入文件

URL res = getClass().getClassLoader().getResource("resources/output.txt");
                    File file = Paths.get(res.toURI()).toFile();
                    System.out.println(file);
                    PrintWriter  writer = new PrintWriter (file);
                    writer.write(fileContent);
                    writer.close();

I am able to see the output in the windows file system(C:\dsassignment\ShortestPath\bin\resources\output.txt) but eclipse is not showing the output file content

任何帮助都是值得的


共 (0) 个答案