Cannot create new file: device not ready

I create a new file using Java, but get an exception:

Exception in thread "main" java.io.IOException: The device is not ready at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:947) at pdfconverter.PdfConverter.main(PdfConverter.java:96) 

Java Result: 1

In my line 96, this Condition:

 if (!logfile.exists()) { logfile.createNewFile();//line 96 } 

I have used this before and I don’t understand what is happening. Since I logged in as administrator. Please, help.

+4
source share
1 answer

The problem was in a path that was not found because someone renamed the drive letter from F to D. Sorry for not noticing that on time.

+6
source

Source: https://habr.com/ru/post/1445496/