java.io.IOException: 系统找不到指定的路径
2017-02-23 18:48
330 查看
java.io.IOException: 系统找不到指定的路径。at java.io.WinNTFileSystem.createFileExclusively(Native Method) 我想大家一定会碰到这种错误。解决办法是先创建目录。然后创建文件。
File f=new File("E:/www");
if(!f.exists()){
f.mkdirs();
}
File f1=new File("E:/www/1.txt");
f1.createNewFile();
System.out.println(f1.exists());
File f=new File("E:/www");
if(!f.exists()){
f.mkdirs();
}
File f1=new File("E:/www/1.txt");
f1.createNewFile();
System.out.println(f1.exists());
相关文章推荐
- POI导出文件报错 java.lang.RuntimeException: java.io.IOException: 系统找不到指定的路径。
- log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException: ..\logs\2010-1-19.log (系统找不到指定的路径。)
- Log4J配置后, log4j:ERROR setFile(null,true) call failed. 报错:java.io.FileNotFoundException: /log/mytest2.log (系统找不到指定的路径。)
- Jenkins java.io.IOException: CreateProcess error=2, 系统找不到指定的文件。
- 解决java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, 系统找不到指定的文件 的错误
- java.io.FileNotFoundException: .\xxx\xxx.png (系统找不到指定的路径。)
- Android 混淆提示 java.io.FileNotFoundException: ...\proguard-rules\release\aapt_rules.txt (系统找不到指定的路径)
- java.io.FileNotFoundException: D:\workspace\gbrm\WebRoot\空缺职位列表20140414093026.xls (系统找不到指定的路径。)
- Android 混淆提示 java.io.FileNotFoundException: ...\proguard-rules\release\aapt_rules.txt (系统找不到指定的路径)
- Java学习笔记(二十二):Java 文件操作 :系统找不到指定的路径
- Error:java.io.FileNotFoundException: 系统找不到指定的文件.
- Java 文件操作 :系统找不到指定的路径
- java:eclipse:windows开发环境log4j系统找不到指定的路径 推荐
- 如何解决java.io.FileNotFoundException: mysql.ini (系统找不到指定的文件。)
- java读写properties文件,解决系统找不到指定路径,解决写入后读取正常,但文件数据未更新问题
- java.io.FileNotFoundException关于使用Intellij Idea时系统找不到指定文件的解决方案
- nested exception is java.io.FileNotFoundException: config.xml (系统找不到指定的文件。)
- java 如果文件目录不存在就创建再写文件的代码实例--针对“系统找不到指定的路径”问题。
- java.io.FileNotFoundException: D:\Workspaces\MyEclipse 8.5\spring\applicationContext.xml (系统找不到指定的文
- VS05 WM开发 报错:系统找不到指定的路径 0x80070003