How can I list all classes loaded in a specific class loader
问题 For debug reasons, and curiosity, I wish to list all classes loaded to a specific class loader. Seeing as most methods of a class loader are protected, what is the best way to accomplish what I want? Thanks! 回答1: Instrumentation.getInitiatedClasses(ClassLoader) may do what you want. According to the docs: Returns an array of all classes for which loader is an initiating loader. I'm not sure what "initiating loader" means though. If that does not give the right result try using the