Java ClassPath Get getClasspath()

Here you can find the source of getClasspath()

Description

get Classpath

License

Apache License

Declaration

public static List<URL> getClasspath() 

Method Source Code

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

import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<URL> getClasspath() {
        ArrayList<URL> classpath = new ArrayList<URL>();

        ClassLoader cl = ClassLoader.getSystemClassLoader();

        URL[] urls = ((URLClassLoader) cl).getURLs();

        for (URL url : urls) {
            classpath.add(url);/*  w w w .  ja v a2s  . c  om*/
        }

        return classpath;
    }
}

Related

  1. getClassFromLibs(String className, List libs, boolean useSystemClassPath)
  2. getClassLoaderClasspath(ClassLoader loader)
  3. getClasspath()
  4. getClasspath()
  5. getClassPath()
  6. getClasspath()