title: Quartz Scheduler error in Eclipse - creating a new trigger
body: <p>I am trying out Quartz Scheduler and I am writing a small test program in Eclipse, but the Eclipse editor keeps underlining in red the .withSchedule line.  The .build(); line also has a small red underline between the second parentheses and the semi-colon.</p>
  
  <p>When I hover the mouse over .withSchedule, Eclipse says:</p>
  
  <p>"The method withSchedule(CalendarIntervalScheduleBuilder) is undefined for the type Date"</p>
  
  <p>Here is the code:</p>
  
  <pre><code>import static org.quartz.JobBuilder.*;
  import static org.quartz.TriggerBuilder.*;
  import static org.quartz.CalendarIntervalScheduleBuilder.*;
  import static org.quartz.JobKey.*;
  import static org.quartz.TriggerKey.*;
  import static org.quartz.DateBuilder.*;
  
  import org.quartz.JobDetail;
  import org.quartz.Scheduler;
  import org.quartz.SchedulerException;
  import org.quartz.SchedulerFactory;
  import org.quartz.Trigger;
  import org.quartz.impl.StdSchedulerFactory;
  
  public class JobScheduler 
  {
  
      Scheduler sched;
  
  
      public JobScheduler()
      {
          try 
          {
              SchedulerFactory schedFact = new StdSchedulerFactory();
              sched = schedFact.getScheduler();
              sched.start();
          } 
          catch (SchedulerException e) 
          {
              e.printStackTrace();
          }
      }
  
  
      public void scheduleEmailJob(String from, String to, String subject, String message)
      {
  
          JobDetail job = newJob(EmailJob.class)
                    .withIdentity("myJob", "group1")  
                    .usingJobData("from", from)
                    .usingJobData("to", to)
                    .usingJobData("subject", subject)
                    .usingJobData("message", message)
                    .build();
  
          Trigger trigger = newTrigger()
                  .withIdentity("trigger3", "group1")
                  .startAt(tomorrowAt(15, 0, 0)  
                  .withSchedule(calendarIntervalSchedule()  // &lt;------
                          .withIntervalInDays(1)) 
                  .build();                                 // &lt;------
  
          try 
          {
              sched.scheduleJob(job, trigger);
          } 
          catch (SchedulerException e) 
          {
              e.printStackTrace();
          }
      }   
  }
  </code></pre>
  
  <p>Does anyone know why this is happening?</p>
  
  <p>I got the code snippet at the bottom of the page here:</p>
  
  <p><a href="http://quartz-scheduler.org/documentation/quartz-2.2.x/cookbook/DailyTrigger" rel="nofollow">http://quartz-scheduler.org/documentation/quartz-2.2.x/cookbook/DailyTrigger</a></p>