SimpleTrigger simpleTrigger = TriggerBuilder.newTrigger() .withIdentity("trigger3", "group1") .startAt(new Date()) .withSchedule( SimpleScheduleBuilder.simpleSchedule() .withIntervalInSeconds(3) .withRepeatCount(0))//重复执行的次数,因为加入任务的时候马上执行了,所以不需要重复,否则会多一次。 .build(); scheduler.scheduleJob(jobDetail, simpleTrigger);