i need help to run my Java program on the server at a specific time like 2 pm (to index the new files).
Someone told me that Java has some thing called jobs but I don't know how to work with that. I tried this:
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;
}
But with this the program is still running.
How could I run my program at a specified time?