r/javahelp • u/Puzzleheaded_Ear3790 • Jul 15 '25
JavaFX + jpackage: Reduce startup time using CDS?
We have a lightweight JavaFX Maven project (JDK 21) packaged using jlink + jpackage into an .msi installer.
However, after installation, launching the app takes 4–6 seconds, despite it only displaying a small table (10–15 rows from a text file).
I profiled startup and found most of the time is spent loading JVM base classes. Online suggestions pointed to using CDS (Class Data Sharing) to speed this up.
I tried various ways to integrate CDS with jpackage, but couldn't get it working. The process is quite confusing.
Has anyone successfully used CDS with jpackage? Would appreciate tips or a working pom.xml example.
Thanks!
View all comments
Show parent comment
1
u/milchshakee Jul 15 '25
No, the file is part of the jlink image and is generated at the right place. You don't have to do anything, it will work automatically