Java ClassPath dumpClasspath(ClassLoader loader)

Here you can find the source of dumpClasspath(ClassLoader loader)

Description

dump Classpath

License

Apache License

Declaration

public static void dumpClasspath(ClassLoader loader) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URLClassLoader;
import java.util.Arrays;

public class Main {
    public static void dumpClasspath(ClassLoader loader) {
        System.out.println("Classloader " + loader + ":");

        if (loader instanceof URLClassLoader) {
            URLClassLoader ucl = (URLClassLoader) loader;
            System.out.println("\t" + Arrays.toString(ucl.getURLs()));
        } else/*from ww  w  .ja  v  a  2s.  com*/
            System.out.println("\t(cannot display components as not a URLClassLoader)");

        if (loader.getParent() != null)
            dumpClasspath(loader.getParent());
    }
}

Related

  1. calculateClassPath(ClassLoader cl)
  2. createClassLoader(List classpathElements, String... paths)
  3. createClassLoader(List libs, boolean useSystemClassPath)
  4. createClassPath(File file)
  5. existsInClasspath(Class clazz, String fileName)
  6. existsInClasspath(final String fileName)
  7. fillClassPath(ClassLoader cl, StringBuffer classpath)
  8. findClassPaths()