1

我正在尝试从这里使用 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);
4

1 回答 1

2

你包括了这个吗?

using org.quartz.SimpleScheduleBuilder.*;

(谢谢)

于 2013-09-09T13:42:04.073 回答