-Xshare:auto, which is the default, is supposed to use the specified archive if possible, but otherwise the VM should continue normal execution and ignore the specified archive(s).
However, in some cases, a bad archive would cause the VM to fail during start-up:
See attachments for bug.sh and log.txt
$ bash bug.sh $JAVA 2>&1 | cat > log.txt
$ cat log.txt
[....]
----------------------------------------------------------------------
Test case 2A: bad dynamic archive header, two archives
----------------------------------------------------------------------
+ /home/iklam/jdk/bld/nep/images/jdk/bin/java -Xshare:auto -Xlog:cds -cp HelloWorld.jar -XX:SharedArchiveFile=base.jsa:yyy.jsa HelloWorld
Error occurred during initialization of VM
Not a top shared archive: yyy.jsa
=====================================
Proposed new behavior:
-XX:SharedArchiveFile=foo.jsa
-> if foo.jsa cannot be loaded, continue execution with CDS disabled
-XX:SharedArchiveFile=base.jsa:top.jsa
-> if top.jsa cannot be loaded, or does not match base.jsa
-> if base.jsa cannot be loaded, continue execution with CDS disabled
-> if base.jsa can be loaded, continue execution with only base.jsa loaded
continue execution with CDS disabled