title: run a Java program in specific time
body: <p>i need help to run my Java program on the server at a specific time like 2 pm (to index the new files).</p>
  
  <p>Someone told me that Java has some thing called jobs but I don't know how to work with that. I tried this:</p>
  
  <pre><code> boolean cond=true;
   while(cond){
       @SuppressWarnings("deprecation")
       int heur = new Date().getHours();
       @SuppressWarnings("deprecation")
       int minute= new Date().getMinutes();
       if(heur==16 &amp;&amp; minute==02){
           indexer.close();
           end = new Date().getTime();
           File f;
           cond=false;
       }
  </code></pre>
  
  <p>But with this the program is still running.</p>
  
  <p>How could I run my program at a specified time?</p>