$ unzip pkg.zip
$ java -XX:ArchiveClassesAtExit=foo.jsa -cp pkg.jar pkg.Foo
$ java -XX:SharedArchiveFile=foo.jsa -cp pkg.jar pkg.Foo Baz
pkg.Bar
Exception in thread "main" java.lang.IllegalAccessError: class pkg.Baz cannot access its superinterface pkg.Bar (pkg.Baz and pkg.Bar are in unnamed module of loader 'app')
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1010)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
The bug seems to happen after JDK-8249262