# Scheduled Tasks

Scheduled tasks in Spring allow you to perform repeated operations or execute specific code at defined intervals or schedules.

IntelliJ IDEA provides the following tools to make it easier to work with scheduled tasks:

* [Support for cron expressions](#cron)

* [Ability to trigger scheduled methods](#scheduled-methods)

## Cron expression support

IntelliJ IDEA provides coding assistance and human-readable descriptions for cron expressions in scheduled Spring, Quarkus, and Micronaut services.

Procedure: Enable the Cron Expressions plugin

This functionality relies on the [Cron Expressions](https://plugins.jetbrains.com/plugin/24438-cron-expressions)  plugin, which  is bundled and enabled in IntelliJ IDEA   by default. If the relevant features are not available, make sure that you did not disable the plugin.

> **Note:**
> The Cron Expressions plugin is not available in IntelliJ IDEA without the Ultimate subscription.

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) to open settings and then select `Plugins`.

2. Open the Installed tab, find the Cron Expressions plugin, and select the checkbox next to the plugin name.

When you use cron expressions in scheduled tasks, the cron expression language is [injected](using-language-injections.html) providing you with corresponding coding assistance, such as completion and syntax validation. Human-readable explanations appear in inlay hints, making it easier to quickly understand and verify cron expressions.

![Cron expression explanations](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_cron_injected.png)

To get a list of cron expression examples, press `Ctrl+Space` (Windows), `⌃ Space` (macOS), `⌃ Space` (IntelliJ IDEA Classic (macOS)), `⌃ Space` (macOS System Shortcuts), `Ctrl+Space` (XWin), `Ctrl+Space` (GNOME), `Ctrl+Space` (KDE), `Alt+/` (Emacs), `Ctrl+Space` (Sublime Text), `⌃ Space` (Sublime Text (macOS)), `Ctrl+Space` (NetBeans), `Ctrl+Space` (Visual Studio), `⌃ Space` (Visual Studio (macOS)), `Ctrl+Space` (Eclipse), `⌃ Space` (Eclipse (macOS)) after the `cron` keyword.

![Cron expression examples](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_cron_examples.png)

## Spring Scheduled methods

If you want to debug a scheduled method, you don't have to wait for it to start: IntelliJ IDEA lets you trigger it right away using the dedicated gutter icon.

Procedure: Enable scheduled debugger

To trigger scheduled methods, we have to add a JVMTI agent to your application. It will be suggested when you click the Trigger the @Scheduled method icon ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.icons.cdi.newui.scheduledEventRun%4014x14.svg), but you can also add it manually in the Spring Boot run configuration.

1. In the main menu, go to `Run | Edit Configurations` or press `Alt+Shift+F10` (Windows), `⌃ ⌥ R` (macOS), `⌥ ⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ R` (macOS System Shortcuts), `Alt+Shift+F10` (XWin), `Alt+Shift+F10` (GNOME), `Alt+Shift+F10` (KDE), `Alt+Shift+F10` (Emacs), `Alt+Shift+F10` (Sublime Text), `⌃ ⌥ R` (Sublime Text (macOS)), `Alt+Shift+F10` (NetBeans), `Ctrl+Alt+Shift+R` (Visual Studio), `⌘ ⌥ ⇧ R` (Visual Studio (macOS)), `Alt+Shift+F10` (Eclipse), `⌃ ⌥ R` (Eclipse (macOS)).

2. Select your Spring Boot run configuration or create a new one by clicking ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.add.svg).

3. Click Modify options and select Enable Scheduled Debugger.

Procedure: Trigger scheduled methods

1. Run your application by pressing `Shift+F10` (Windows), `⌃ R` (macOS), `⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ R` (macOS System Shortcuts), `Shift+F10` (XWin), `Shift+F10` (GNOME), `Shift+F10` (KDE), `Shift+F10` (Emacs), `Shift+F10` (Sublime Text), `Shift+F10` (Sublime Text (macOS)), `F6` (NetBeans), `Ctrl+F5` (Visual Studio), `⌃ F5` (Visual Studio (macOS)), `Alt+Shift+X` (Eclipse), `⌘ ⇧ F11` (Eclipse (macOS)) or clicking ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.run.svg). Or start the debugger session by pressing `Shift+F9` (Windows), `⌃ D` (macOS), `⇧ F9` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ D` (macOS System Shortcuts), `Shift+F9` (XWin), `Shift+F9` (GNOME), `Shift+F9` (KDE), `Shift+F9` (Emacs), `Shift+F9` (Sublime Text), `⌃ D` (Sublime Text (macOS)), `Ctrl+F5` (NetBeans), `Alt+F5` (Visual Studio), `⌥ F5` (Visual Studio (macOS)), `Alt+Shift+D` (Eclipse), `⌘ F11` (Eclipse (macOS)) or clicking ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.run.debug.svg).

2. In the gutter, next to a method annotated with `@Scheduled`, click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.icons.cdi.newui.scheduledEventRun%4014x14.svg). This will trigger the method regardless of the configured interval.

![Trigger scheduled methods](https://resources.jetbrains.com.cn/help/img/idea/2026.2/spring_scheduled_methods_gutter_icon.gif)

