$ cat HelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
$ java -Xshare:off -XX:DumpLoadedClassList=jc.classlist com.sun.tools.javac.Main -d . HelloWorld.java
$ java -XX:+PreloadSharedClasses -XX:+UseZGC -Xshare:dump -Xlog:cds -XX:SharedArchiveFile=jc.jsa -XX:SharedClassListFile=jc.classlist com.sun.tools.javac.Main -d . HelloWorld.java
# assert(CDSConfig::is_dumping_invokedynamic()) failed: lambda form classes are archived only if ArchiveInvokeDynamic is true
#
# JRE version: Java(TM) SE Runtime Environment (24.0) (fastdebug build 24-internal-adhoc.iklam.le6)
# Java VM: JavaHotSpot(TM) 64-Bit Server VM (fastdebug 24-internal-adhoc.iklam.le6, interpreted mode, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x5ec2b9] ArchiveBuilder::update_hidden_class_loader_type(InstanceKlass*)+0x179
#
V [libjvm.so+0x5ec2b9] ArchiveBuilder::update_hidden_class_loader_type(InstanceKlass*)+0x179 (archiveBuilder.cpp:302)
V [libjvm.so+0x5f1928] ArchiveBuilder::gather_klass_and_symbol(MetaspaceClosure::Ref*, bool)+0x1b8 (archiveBuilder.cpp:237)
V [libjvm.so+0x1431976] MetaspaceClosure::do_push(MetaspaceClosure::Ref*)+0x76 (metaspaceClosure.cpp:63)
V [libjvm.so+0x1431acf] MetaspaceClosure::push_impl(MetaspaceClosure::Ref*)+0xaf (metaspaceClosure.cpp:36)
V [libjvm.so+0x181beac] DumpTimeClassInfo::metaspace_pointers_do(MetaspaceClosure*)+0x5c (metaspaceClosure.hpp:283)
V [libjvm.so+0x1815f17] SystemDictionaryShared::dumptime_classes_do(MetaspaceClosure*)+0xb97 (systemDictionaryShared.cpp:738)
V [libjvm.so+0x143d962] StaticArchiveBuilder::iterate_roots(MetaspaceClosure*)+0x22 (metaspaceShared.cpp:520)
V [libjvm.so+0x5eef21] ArchiveBuilder::gather_klasses_and_symbols()+0x131 (archiveBuilder.cpp:259)
V [libjvm.so+0x5ef18e] ArchiveBuilder::gather_source_objs()+0x7e (archiveBuilder.cpp:568)
V [libjvm.so+0x1437e26] VM_PopulateDumpSharedSpace::doit()+0xe6 (metaspaceShared.cpp:575)
V [libjvm.so+0x195bdf7] VM_Operation::evaluate()+0xf7 (vmOperations.cpp:75)
V [libjvm.so+0x19834d8] VMThread::evaluate_operation(VM_Operation*)+0xe8 (vmThread.cpp:286)
V [libjvm.so+0x198408f] VMThread::inner_execute(VM_Operation*)+0x3bf (vmThread.cpp:430)
V [libjvm.so+0x1984274] VMThread::loop()+0x84 (vmThread.cpp:496)
V [libjvm.so+0x1984452] VMThread::run()+0x162 (vmThread.cpp:180)
V [libjvm.so+0x186531a] Thread::call_run()+0xba (thread.cpp:236)
V [libjvm.so+0x153f558] thread_native_entry(Thread*)+0x1c8 (os_linux.cpp:849)
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
}
$ java -Xshare:off -XX:DumpLoadedClassList=jc.classlist com.sun.tools.javac.Main -d . HelloWorld.java
$ java -XX:+PreloadSharedClasses -XX:+UseZGC -Xshare:dump -Xlog:cds -XX:SharedArchiveFile=jc.jsa -XX:SharedClassListFile=jc.classlist com.sun.tools.javac.Main -d . HelloWorld.java
# assert(CDSConfig::is_dumping_invokedynamic()) failed: lambda form classes are archived only if ArchiveInvokeDynamic is true
#
# JRE version: Java(TM) SE Runtime Environment (24.0) (fastdebug build 24-internal-adhoc.iklam.le6)
# Java VM: JavaHotSpot(TM) 64-Bit Server VM (fastdebug 24-internal-adhoc.iklam.le6, interpreted mode, tiered, compressed class ptrs, z gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x5ec2b9] ArchiveBuilder::update_hidden_class_loader_type(InstanceKlass*)+0x179
#
V [libjvm.so+0x5ec2b9] ArchiveBuilder::update_hidden_class_loader_type(InstanceKlass*)+0x179 (archiveBuilder.cpp:302)
V [libjvm.so+0x5f1928] ArchiveBuilder::gather_klass_and_symbol(MetaspaceClosure::Ref*, bool)+0x1b8 (archiveBuilder.cpp:237)
V [libjvm.so+0x1431976] MetaspaceClosure::do_push(MetaspaceClosure::Ref*)+0x76 (metaspaceClosure.cpp:63)
V [libjvm.so+0x1431acf] MetaspaceClosure::push_impl(MetaspaceClosure::Ref*)+0xaf (metaspaceClosure.cpp:36)
V [libjvm.so+0x181beac] DumpTimeClassInfo::metaspace_pointers_do(MetaspaceClosure*)+0x5c (metaspaceClosure.hpp:283)
V [libjvm.so+0x1815f17] SystemDictionaryShared::dumptime_classes_do(MetaspaceClosure*)+0xb97 (systemDictionaryShared.cpp:738)
V [libjvm.so+0x143d962] StaticArchiveBuilder::iterate_roots(MetaspaceClosure*)+0x22 (metaspaceShared.cpp:520)
V [libjvm.so+0x5eef21] ArchiveBuilder::gather_klasses_and_symbols()+0x131 (archiveBuilder.cpp:259)
V [libjvm.so+0x5ef18e] ArchiveBuilder::gather_source_objs()+0x7e (archiveBuilder.cpp:568)
V [libjvm.so+0x1437e26] VM_PopulateDumpSharedSpace::doit()+0xe6 (metaspaceShared.cpp:575)
V [libjvm.so+0x195bdf7] VM_Operation::evaluate()+0xf7 (vmOperations.cpp:75)
V [libjvm.so+0x19834d8] VMThread::evaluate_operation(VM_Operation*)+0xe8 (vmThread.cpp:286)
V [libjvm.so+0x198408f] VMThread::inner_execute(VM_Operation*)+0x3bf (vmThread.cpp:430)
V [libjvm.so+0x1984274] VMThread::loop()+0x84 (vmThread.cpp:496)
V [libjvm.so+0x1984452] VMThread::run()+0x162 (vmThread.cpp:180)
V [libjvm.so+0x186531a] Thread::call_run()+0xba (thread.cpp:236)
V [libjvm.so+0x153f558] thread_native_entry(Thread*)+0x1c8 (os_linux.cpp:849)