Skip to content
Advertisement

Java – Get a list of all Classes loaded in the 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.

Advertisement

Answer

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.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement