我正在尝试初始化 FileHandler 以写入给定的文件名,并使用以下语法进行可选附加:
FileHandler fh = null;
fh = new FileHandler("C:\\Users\\Desktop\\New_folder\\logs\\slate\\TodayLoad-2013-10-24.log",true);
但我得到的例外是:
java.io.IOException: Couldn't get lock for C:\Users\Desktop\New_folder\logs\slate\TodayLoad-2013-10-24.log
at java.util.logging.FileHandler.openFiles(Unknown Source)
at java.util.logging.FileHandler.<init>(Unknown Source)
at TodayLoad.Load.<init>(SlateSheetLoad.java:173)
at TodayLoad.Load.SlateSheetLoad.main(SlateSheetLoad.java:423)
我该如何解决这个问题。