我正在尝试使用来自here的Quartz文档代码,但它不起作用。我的程序无法识别第10行中的simpleSchedule()
!
// define the job and tie it to our HelloJob class
JobDetail job = newJob(HelloJob.class)
.withIdentity("myJob", "group1") // name "myJob", group "group1"
.build();
// Trigger the job to run now, and then every 40 seconds
Trigger trigger = newTrigger()
.withIdentity("myTrigger", "group1")
.startNow()
.withSchedule(simpleSchedule()
.withIntervalInSeconds(40)
.repeatForever())
.build();
// Tell quartz to schedule the job using our trigger
sched.scheduleJob(job, trigger);
答案 0 :(得分:2)
你有这个吗?
using org.quartz.SimpleScheduleBuilder.*;
(感谢)