// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.net.URL;
import java.net.URLClassLoader;

public class ClassPath {
    public static void main(String[] args) {
        String[] cp = System.getProperty("java.class.path").split(";");
        for(int i = 0; i < cp.length; i++) {
            System.out.println(cp[i]);
        }
        ClassLoader cl = ClassPath.class.getClassLoader();
        while(cl != null) {
            if(cl instanceof URLClassLoader) {
                URL[] urls = ((URLClassLoader)cl).getURLs();
                for(int i = 0; i < urls.length; i++) {
                    System.out.println(urls[i]);
                }
            }
            cl = cl.getParent();
        }
    }
}
