📅  最后修改于: 2022-03-11 14:52:08.741000             🧑  作者: Mango
final ClassLoader loader = Thread.currentThread().getContextClassLoader();
for (final ClassPath.ClassInfo info : ClassPath.from(loader).getTopLevelClasses()) {
if (info.getName().startsWith("my.package.")) {
final Class> clazz = info.load();
// do something with your clazz
}
}