CoderSathi
  • Tutorial
    • Java Tutorial
    • Swing Tutorial
    • JDBC Tutorial
    • Java String Tutorial
    • Servlet and JSP Tutorial
  • Mongo DB
  • AWS
  • DevOps
  • Linux
  • Git
Home > How to > How to create Windows Task Scheduler and run a Java application?

Java Tutorial

  • Introduction
    • What is Java
    • History Of Java
    • Install Java
    • What is JVM
    • JDK vs JRE vs JVM
    • Java Bytecode
    • OOP vs POP
    • Compile and Run Java
  • Tokens, Expressions and Control Structures
    • Primitive data types
    • Integers
    • Floating Points
    • Characters
    • Booleans
    • User Defined Data Type
    • Declarations
    • Constants
    • Identifiers
    • Literals
    • Type Conversion and Casting
    • Variables
    • Default Variable Initialization
    • Command Line Arguments
    • Arrays of Primitive Types
    • Comment Syntax
    • Garbage Collection
    • Expressions
    • Operators
    • Arithmetic Operator
    • Bitwise and Shift Operator
    • Comparison or Relational Operators
    • Logical Operators
    • Assignment Operators
    • Ternary Operator
    • Increment and Decrement Operator
    • Control Statements
  • OOP Concepts
    • Class and Object
    • Create Class Instance
    • Method
    • Abstraction
    • Encapsulation
    • this keyword
    • Constructor
    • Pass by Value
    • Access Modifier/Control
    • Polymorphism
    • Method Overloading vs Method Overriding
    • Recursion
    • Nested and Inner Class
  • Inheritance and Packaging
    • Inheritance
    • extends Keyword
    • super Keyword
    • Object Class
    • Abstract class
    • Final Class
    • Java Package
    • Interface
  • Handling Error/ Exceptions
    • What is Exception
    • Exception Handling Keywords
    • Common Java Errors
    • User Defined Exception
    • Throwing and re-throwing Exception
    • finally Block
  • Strings
    • Java String Tutorial
  • Threads
    • Introduction
    • Create Thread
    • Thread Lifecycle
    • Thread Priority
    • Thread Synchronization
    • Inner Thread Communication
    • Thread Deadlock
  • IO and Streams
    • java.io Package
    • Files and Directories
    • Byte Stream
    • Character Stream
    • Console Input and Output
    • Serializable and Deserializable
  • Core Packages
    • java.lang Package
    • Math
    • Wrapper Classes
    • java.lang.Number
    • Double
    • Float
    • Integers
    • java.lang.Byte
    • java.lang.Short
    • java.lang.Long
    • java.lang.Character
    • java.lang.Boolean
    • java.util package
    • Vector Class
    • Stack Class
    • Dictionary Class
    • Hashtable
    • Enumeration or Enum
    • Generate Random Number
  • Holding Collection of Data
    • Arrays
    • Map
    • List
    • Set
    • Collection Interface
    • Collections Class
    • ArrayList
    • HashSet
    • TreeSet
    • Comparator
  • Java Bean
    • What is Java Bean
    • Advantages and Disadvantages of Java Bean
    • Java Beans API
    • Introspection
    • Java Bean Properties
    • Bound and Constrained Properties
    • BeanInfo Interface
    • Customizers
    • Java Beans Persistence
    • BeanDescriptor

How to create Windows Task Scheduler and run a Java application?

Learn the concepts, implementation details, and practical steps with a clean developer-focused walkthrough.

Yuba Raj Kalathoki
By Yuba Raj Kalathoki
Last updated: July 1, 2026 · 3 min read · 0 Comments
Share: in X

Overview

In this post, we will learn to create Windows Task Scheduler to run/start our application.

Here, I will explain how we can schedule to start our Java application with windows task scheduler.

Prerequisite

  • A jar file that contains our java application

Solution

We need to create a bat file so that the windows task scheduler will start our java application. If you don’t know how to create a bat file then please check out the article how to run a jar file from batch file. Where I have explained about it.

I am assuming that you have created a bat file that executes the jar file.

Let’s assume the following use case.

Use case

We have a jar file and want to start/run it by windows task scheduler everyday in every 1 hour.

We will be following the above use case to create a windows task scheduler.

Steps to create a Windows Task Scheduler

  1. Search Task Scheduler. You can do this after clicking icon. You may see the following:
Windows task scheduler
  1. Open it and the following window will be displayed
windows task scheduler window
  1. Under Task Scheduler (Local), select Task Scheduler Library and click New Folder from the Actions panel and give a folder name, and click ok. (I would recommend you to create a folder and keep all the tasks under it. Otherwise, you may find difficulties in locating the newly created task.)
  2. Select the folder you’ve created earlier.
  3. Now you can click on the Create task… which is under the Actions panel on the right side.
  4. In the general tab:
    • Name: MyTask
    • Description: Demo Task
  5. On the Triggers tab:
    • Click on the New… button.
    • Select Daily
    • On the Advanced Setting, check Repeat task every. The default value is 1 Hour.
  6. On the Actions tab:
    • Click on the New.. button.
    • Things to remember:
      • If your batch file location is: C:\my-folder\HelloWorld.bat then should set the value,
      • Program/Script: HelloWorld.bat
      • Start in (Optional): C:\my-folder
  7. If you want to change the configuration based on your requirement you can modify the Conditions and Settings tab accordingly.

Optional but important

If your task is not stopping properly and causing problem while starting next time then, open your task from Task Scheduler list, got to Setting tab select Stop the existing instance option which can be found under the If the task is already running, then the following rule applies: section.
  1. Click Ok to all popup one by one.
  2. The task should be created successfully.

Now, you can test the task.

Select the folder you have created.

Select the Task you’ve created.

Right click on it and click Run. You can also run the task rom Actions panel in the right side.

Conclusion

In the post, we’ve successfully created a task in Windows Task Scheduler to run our Java application.

Related Posts:

  • How to Run JAR File: Step-by-Step Guide
  • How to Create Executable JAR File (3 Methods Explained)
  • Most Frequently Asked Spring Boot Interview…
  • Control Statements in Java
  • MySQL Commands for Developers
  • What Is Java Swing? A Complete Guide to Java’s GUI Toolkit
Tags:javatask-schedulerwindows
Was this article helpful?
← Previous ArticleHow to Run JAR File: Step-by-Step Guide
Next Article →Difference between @PathVariable and @RequestParam

Leave a Comment Cancel reply

You must be logged in to post a comment.

Recent Posts

  • How to implement Passwordless Authentication in Spring Boot: A Step-by-Step Guide
  • How to Use AWS CloudFront Signed URLs in Spring Boot?
  • How to Fix SSH Agent Forwarding on macOS: The Ultimate Guide for Developers
  • How to Read AWS Secrets Manager in Spring Boot (Step-by-Step)
  • How to Fix “Public Key Retrieval is not allowed” MySQL JDBC Error
CoderSathi

Your go-to resource for Java, Spring Boot, Microservices, AWS, and modern development tutorials.

Linkedin

Quick Links

  • About
  • Contact

Popular Topics

  • Java
  • Spring Boot
  • AWS
  • DevOps
  • MongoDB
  • Linux
  • Git
  • How to
© 2026 CoderSathi. All rights reserved. Privacy Policy · Sitemap