user618111
user618111

Reputation: 439

Is there any other method for java scheduler more easier to understand than Quartz?

I've created a small java program and I want to launch it everyday at 1 o'clock. I can add it windows task plannifier and it works very well but I want to do it with java.

The java timer task seems to be not good.

I heard about Quartz and when I try their it seems to be complicated for me or I don't find the simple example or tutorial.

Can anyone know some good tutorial or example code easier than the Quartz's site. Or redirect me to some other site.

Upvotes: 0

Views: 935

Answers (5)

Dead Programmer
Dead Programmer

Reputation: 12575

small java program and I want to launch it everyday at 1 o'clock
  1. cronjob in unix

    Scheduling a Job For a Specific Time Every Day

The basic usage of cron is to execute a job in a specific time as shown below.This will execute the sample_java_program everyday at 1am.

30 01 * * * java /home/suresh/sample_java_program

    * 30 – 30th Minute
    * 01 – 01 AM
    * * – every Day
    * * – every Month 
    * * – Every day of the week
  1. Scheduling in windows this link might help u .

Upvotes: 1

user618111
user618111

Reputation: 439

When you say: Both Quartz and the built in Timer class are not built to start your whole application.

So i could never launch my whole java program with Quartz or Timer. it only launches some speicfic task while my prg is running?

so it's better to keep Windows task Scheduler? ok thank you

Upvotes: 0

Jigar Joshi
Jigar Joshi

Reputation: 240860

Quartz

Quartz is a full-featured, open source job scheduling service that can be integrated with, or used along side virtually any Java EE or Java SE application.

The basic terminology are (at very basic view):

Scheduler : You can think of this as the core container or something that is the base of quartz.

Job : You can think this as the task we need to do , out simple java Class

Trigger : Something that will make Job to run on scheduler, there are two types of trigger with quartz

  1. Simple Trigger (you can configure it with delay between execution, delay for first execution . . and many such params)
  2. Cron-Trigger : Here you can configure trigger with cron expression.

Also See

Upvotes: 2

PeterMmm
PeterMmm

Reputation: 24630

cron4j is another one

Upvotes: 0

Joachim Sauer
Joachim Sauer

Reputation: 308001

Both Quartz and the built in Timer class are not built to start your whole application. They are built to run some specified tasks according to some schedule as long as your application is running.

To actually start your application at a specified time, an external resource will be necessary (unless you want your application to run at all times and only do some activity ever so often).

For that purpose the Windows Task Scheduler is sufficient.

Upvotes: 3

Related Questions