Skip to content

Leyden AOT Cache Usage And Configuration

Martin Lippert edited this page Mar 13, 2026 · 1 revision

What is Project Leyden?

Project Leyden is an OpenJDK project that aims to improve startup time, time to peak performance, and footprint of the Java platform. One of its features is the AOT (Ahead-of-Time) Cache (also known as Class Data Sharing, CDS), which allows the Spring Tools language server to start significantly faster after an initial training run.

To use this experimental support in the Spring Tools you need to:

  • enable the corresponding preference
  • ensure the language server runs on JDK 25 (required for the AOT Cache feature)

Enabling the Leyden feature

In all environments, enable the Leyden AOT Cache (or JDK 25 AOT Cache) option in the Spring Boot language server settings:

  • VSCode / Cursor: Open Settings (e.g. File > Preferences > Settings or Cmd+, / Ctrl+,), search for “Spring Boot” or “Leyden”, and enable the AOT Cache option for the Spring Boot language server.
  • Eclipse: Open Preferences > Language Servers > Spring Language Servers > Spring Boot Language Server and enable the Leyden AOT Cache option.

VSCode / Cursor

  1. Configure JDK 25 for the language server
    Set the Spring Boot language server to use JDK 25 by configuring spring-boot.ls.java.home in your user or workspace settings. It must point to the installation directory of a JDK 25 (e.g. C:\Program Files\Java\jdk-25 on Windows or /Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home on macOS).

    Example in settings.json:

    "spring-boot.ls.java.home": "/path/to/your/jdk-25"
  2. Enable the Leyden feature
    In Settings, enable the Leyden AOT Cache option for the Spring Boot language server (see above).

The first time the language server starts with this option enabled, it will run a training step to build the AOT cache. Subsequent starts will be much faster. After a little while, a popup will appear and ask you to finish the training run by pressing a button. You need to do this in order to finish the training run successfully and to allow the JVM to write the AOT cache to disc. Subsequent starts will then automatically benefit from the cache and start faster.

(side note: works is under way to eliminate the need for the manual step to finish the training run here)

Eclipse

There is nothing special you need to do.

The Spring Tools 5.1.0 Eclipse distribution ships with and runs on JDK 25 by default. The language server uses that same JDK, so no extra JDK configuration is required.

  1. Enable the Leyden feature (optional)
    If you want to use the AOT Cache, enable the Leyden AOT Cache option in Preferences > Language Servers > Spring Language Servers > Spring Boot Language Server (see above).

  2. Training run
    There is no separate setup step. The training run happens automatically the first time the IDE runs the Spring Boot language server in the background. After that, language server startup will be faster on subsequent runs.

Clone this wiki locally