View Single Post
  #7 (permalink)  
Old 05-23-2008, 09:15 AM
dowell's Avatar
dowell dowell is offline
Member
 
Join Date: May 2008
Posts: 6
dowell is on a distinguished road
Quote:
Originally Posted by rockie12 View Post
I am trying to run a java program every 10 minutes on my windows PC. If I run the program manually all works fine...

java myProgramName

Since windows does not support crontab type functionality, I have installed pycron and it runs my program every ten minutes, but I get a class not found error.

I have tried

0,10,20,30,40,50 * * * * javaw myPackage.com.myProgram


I have added my program to the system environment variable CLASSPATH, but still no success.

Any thoughts on how I can set up cron on windows to run my java application?

Thanks in advance for your assistance
Dean-O

I suggest that you try using a thread. You can set the thread to sleep for 10 minutes i.e Put the main class in an endless loop and put the thread in that loop.
Thread.sleep(600000).

After that you can add its exe jar file to the start-up programs so thats its launched on every log-on or when the computer starts up.

try it out...
Reply With Quote