0

I met the AccessDeniedException when creating a file under the C:\, anyone know how to fix it? BTW, I am already the administrator and I am using Windows 7.

Path path = Paths.get("C://afile");
Files.createFile(path);
Adam Lee
  • 24,710
  • 51
  • 156
  • 236
  • Take a look at this [answer](https://stackoverflow.com/questions/28670576/getting-java-nio-file-accessdeniedexception-when-trying-to-write-to-a-folder) – Fady Saad Jun 02 '17 at 21:52
  • To debug try `Path path = Paths.get("C://blah/afile");` Sometimes windows is strict about root folder – Zakir Jun 02 '17 at 21:54

0 Answers0