Get a verbose output of the classes loaded by the VM

With JDK 1.5 java.lang.management package:

Main.java:

import java.lang.management.*;
 
public class Main
{
   public static void main(String []args) {
      ClassLoadingMBean mbean = ManagementFactory.getClassLoadingMBean();
      mbean.setVerbose(true);
       
      A a = new A();
   }
}
 
class A
{
}

outputs:

[Loaded A from file:/C:/my/jdk1.5/classloadingmbean/verbose/]
[Loaded java.lang.Shutdown from shared objects file]
[Loaded java.lang.Shutdown$Lock from shared objects file]