RFR: 8359423: Improve error message in case of missing jsa shared archive

Evgeny Astigeevich eastigeevich at openjdk.org
Tue Jun 17 16:08:27 UTC 2025


On Tue, 17 Jun 2025 08:17:19 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> In case we use `-Xshare:on` with additional flags (regarding coh or coops) and we have the corresponding jsa archive not present,
> we get this message/error :
> 
> 
> Error occurred during initialization of VM
> Unable to use shared archive.
> 
> 
> The error message could be a little improved, e.g. telling what jsa file is not present .
> For example
> 
> 
> ./images/jdk/bin/java -Xshare:on -version
> [0.017s][error][aot] Opening of static archive /build_linux/images/jdk/lib/server/classes.jsa failed
> Error occurred during initialization of VM
> Unable to use shared archive (unrecoverable archive loading error).

src/hotspot/share/cds/metaspaceShared.cpp line 1274:

> 1272:     vm_exit_during_initialization("Unable to use AOT cache.", nullptr);
> 1273:   } else {
> 1274:     vm_exit_during_initialization("Unable to use shared archive (unrecoverable archive loading error).", nullptr);

Who not to use message here instead of 'unrecoverable archive loading error'? The default message is 'unrecoverable error'. The default message can be updated to 'unrecoverable archive loading error'.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25846#discussion_r2152647530


More information about the hotspot-runtime-dev mailing list