public class LocalVMFinder {
public static Map<Integer, LocalVirtualMachine> getManageableVirtualMachines() {
ConnectionSettings fakeSettings = new ConnectionSettings();
fakeSettings.setConnectionType(new LocalVMTypeDescriptor());
ClassLoader cl = ClassLoaderFactory.getInstance().buildClassLoader(fakeSettings);
try {
Class clazz = Class.forName("org.mc4j.ems.impl.jmx.connection.support.providers.LocalVMProvider",false,cl);
Method m = clazz.getMethod("getManageableVirtualMachines",(Class[])null);