Java - 获取 JVM 中加载的所有类的列表 [英] Java - Get a list of all Classes loaded in the JVM
本文介绍了Java - 获取 JVM 中加载的所有类的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获得属于某个包的所有类及其所有子类的列表.这些类可能已加载或未加载到 JVM 中.
I would like to get a list of all the classes belonging to a certain package as well as all of their children. The classes may or may not be already loaded in the JVM.
推荐答案
好吧,我所做的只是列出类路径中的所有文件.这可能不是一个出色的解决方案,但它运行可靠,并为我提供了我想要的一切,以及更多.
Well, what I did was simply listing all the files in the classpath. It may not be a glorious solution, but it works reliably and gives me everything I want, and more.
这篇关于Java - 获取 JVM 中加载的所有类的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文