我需要帮助来在特定时间(例如下午2点)在服务器上运行我的Java程序(以索引新文件)。在特定时间运行Java程序
有人告诉我,Java有一些东西叫做工作,但我不知道如何使用它。我试过这个:
boolean cond=true;
while(cond){
@SuppressWarnings("deprecation")
int heur = new Date().getHours();
@SuppressWarnings("deprecation")
int minute= new Date().getMinutes();
if(heur==16 && minute==02){
indexer.close();
end = new Date().getTime();
File f;
cond=false;
}
但是,这个程序仍在运行。
如何在特定时间运行我的程序?
PLZ格式的代码正确 – Bohemian 2011-06-01 12:36:29