public void HelloSchedule()throws Exception{
SchedulerFactory sf=new StdSchedulerFactory();
Scheduler sched=sf.getScheduler();
sched.start();
JobDetail job = JobBuilder.newJob(Quartzjob.class)
.withIdentity("job1", "group1").build();
Trigger trigger = TriggerBuilder.newTrigger().withIdentity("trigger1", "group1")
.withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(20)
.repeatForever()).startNow().build();
sched.scheduleJob(job, trigger);
}
异常
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:274)
at quartzSheduler.QuartzTrigger.HelloSchedule(QuartzTrigger.java:28)v
我得到了例外,我使用了Quarta-2.1.5.jar,无论我是否使用交易库