Here you can find the source of invokeGetClasspathMethodIfItExists(ClassLoader cl)
private static String invokeGetClasspathMethodIfItExists(ClassLoader cl)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; public class Main { private static String invokeGetClasspathMethodIfItExists(ClassLoader cl) { Class<?> clazz = cl.getClass(); try {/* w w w . j a v a 2 s. c om*/ Method m = clazz.getMethod("getClasspath"); Object returnValue = m.invoke(cl); if (returnValue instanceof String) { return (String) returnValue; } else { return null; } } catch (NoSuchMethodException e) { return null; } catch (InvocationTargetException e) { return null; } catch (IllegalAccessException e) { return null; } } }