Quartz文档代码不起作用

时间:2013-08-29 07:26:30

标签: asp.net quartz-scheduler

我正在尝试使用来自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);

1 个答案:

答案 0 :(得分:2)

你有这个吗?

using org.quartz.SimpleScheduleBuilder.*;

(感谢)