user234194
user234194

Reputation: 1723

schedule java program

I want to run my java program in regular interval , lets say, in every 3 hours. I am thinking to write a .bat file and put command to call java class. But what is the best way to run .bat regularly in windows xp. Thanks in advance. I dont want to use third party tool.

Upvotes: 0

Views: 1280

Answers (2)

paxdiablo
paxdiablo

Reputation: 882586

Windows scheduled tasks are built for exactly that purpose.

You can run things on multiple schedules (so you can get your every-three-hour behaviour) and you can get your code to run whether or not logged in.

The multiple scheduling is a bit tricky. You basically set it up as a daily task to start with but, near the end, it will ask you if you want to do advanced features.

Select yes then you can set up multiple schedules at that point.

Upvotes: 4

Pablo Santa Cruz
Pablo Santa Cruz

Reputation: 181460

If you want a pure Java Based solution you can try QUARTZ SCHEDULER. But as paxdiablo already mentioned, Windows Task Scheduler will do that as well.

Upvotes: 1

Related Questions