这是我的代码:
public class Test {
public static void main(String[] args) throws Exception {
String logPath = "D:\\mywork\\OMS\\Tymon\\testlog\\testlog.log";
File file = new File(logPath);
SchedulerFactory schedFact = new StdSchedulerFactory();
Scheduler sched = schedFact.getScheduler();
sched.start();
JobDetail jobDetail = new JobDetail("a", "b", TestJob.class);
CronTrigger trigger = new CronTrigger("c", "d");
trigger.setCronExpression("0/23 * * * * ?");
sched.scheduleJob(jobDetail, trigger);
}
}
作业运行时,无法重命名和删除文件“D:\mywork\OMS\Tymon\testlog\testlog.log” 。
似乎文件句柄总是被持有
如何修复它?请帮忙~