public class test {
public static void main(String[] args) throws Exception {
final long PERIOD_DAY = 24 * 60 * 60 * 1000;
Calendar calendar = Calendar.getInstance();calendar.set(Calendar.HOUR_OF_DAY, 10); //开始执行时间
calendar.set(Calendar.MINUTE, 00);
calendar.set(Calendar.SECOND, 0);
Date date=calendar.getTime();
Timer timer = new Timer();
timer.scheduleAtFixedRate(new RemindTask(), date, PERIOD_DAY);
}
}
public class RemindTask extends TimerTask {
@Override
public void run() {
// TODO Auto-generated method stub
System.err.println("job");
}
}