-
Notifications
You must be signed in to change notification settings - Fork 224
Leyden AOT Cache Usage And Configuration
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)
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 > SettingsorCmd+,/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 Serverand enable the Leyden AOT Cache option.
-
Configure JDK 25 for the language server
Set the Spring Boot language server to use JDK 25 by configuringspring-boot.ls.java.homein your user or workspace settings. It must point to the installation directory of a JDK 25 (e.g.C:\Program Files\Java\jdk-25on Windows or/Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Homeon macOS).Example in
settings.json:"spring-boot.ls.java.home": "/path/to/your/jdk-25"
-
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)
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.
-
Enable the Leyden feature (optional)
If you want to use the AOT Cache, enable the Leyden AOT Cache option inPreferences > Language Servers > Spring Language Servers > Spring Boot Language Server(see above). -
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.
- Installation (latest release + snapshots)
- Leyden AOT Cache
- User Guide
- Getting Started
- Navigation
- Live Application Information
- Content Assist
- Version Validation
- Upgrade Support
- Validations and Quick Fixes
- WebFlux Support
- Boot Properties Editor
- Boot Dashboard
- Other Editors
- STS3
- Custom VM args
- FAQ
- Changelog
- Known Limitations & Issues
- Report an Issue
- Developer Manual
- Overview
- Language Server Integration into Clients
- Communication with JDT LS
- Spring Tools Language Server Protocol Extensions