I’ve a main program which performs some task in Java. I want to run it as a batch job & due to our policies, I’m not allowed to use crontab where I can configure it.
What’s the alternate option for me? How can I schedule my Java program to run once a day??
Any sample wrapper code will be helpful!
Thanks!
I’m not sure you want to schedule your job in Java or Bash. If you try to implement in Java, you can try to create a Thread for your job, and let the thread sleep for a period:
And also you can use Timer class, which could also let you create a thread: