title: Java timer with delay never runs
body: <p>I have java.util.Timer class and TimerTask to schedule, I want to do the task every day at 2AM.</p>
  
  <p>My code:</p>
  
  <pre><code>public class AutomaticPuller {
  
      final private Timer t = new Timer();
  
      public AutomaticPuller() {
          Calendar today = Calendar.getInstance();
          today.set(Calendar.HOUR_OF_DAY, 2);
          today.set(Calendar.MINUTE, 0);
          today.set(Calendar.SECOND, 0);
          long cooldown = today.getTimeInMillis();
          if (today.getTime().before(new Date(System.currentTimeMillis()))) {
              cooldown += 24L*60L*60L*1000L;  
          }
          System.out.println("Task will run at: " + new Date(cooldown));
          TimerTask tt = new TimerTask() {
              public void run() {
                  try {
                      updateAll();
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
          };
          t.schedule(tt, cooldown, 24L*60L*60L*1000L);
      }
  }
  </code></pre>
  
  <p>I see the output from println (Task will run at:) but the task that should run at 2AM is never executed, why ? I dont get it I have never met such a problem. No errors in output log.</p>