How to schedule a job using Quartz in Java

Devesh Sharma

Quartz is a richly featured, open source job scheduling library that can be integrated within virtually any Java application. More information about Quartz can be found at this link.


If you are using Maven, add the Quartz dependency to your pom.xml file.

Quartz Job:

Quartz is the job that you want to run after some specific time interval. A sample job class looks like this:

Quartz Trigger/Scheduler:

Quartz Trigger/Scheduler will run your job after specific time interval. A sample trigger/scheduler servlet looks like this:

The above trigger/scheduler servlet runs the job after every 10 seconds.

We are mostly there. Our job is all set to execute every 10 secs now. Just one last but not least thing. We will have to modify our web.xml file to load our QuartzScheduler servlet on the startup of the application. The web.xml file looks like this:


View original post