Here you can find the source of findClassPathsToEn()
public static Enumeration<URL> findClassPathsToEn()
//package com.java2s; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; public class Main { public static Enumeration<URL> findClassPathsToEn() { List<URL> urls = findClassPaths(); final Iterator<URL> iterator = urls.iterator(); return new Enumeration<URL>() { @Override//from ww w .java2s .co m public boolean hasMoreElements() { return iterator.hasNext(); } @Override public URL nextElement() { return iterator.next(); } }; } @SuppressWarnings("deprecation") public static List<URL> findClassPaths() { List<URL> list = new ArrayList<URL>(); String classpath = System.getProperty("java.class.path"); StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator); while (tokenizer.hasMoreTokens()) { String path = tokenizer.nextToken(); File fp = new File(path); if (!fp.exists()) throw new RuntimeException("File in java.class.path does not exist: " + fp); try { list.add(fp.toURL()); } catch (MalformedURLException e) { throw new RuntimeException(e); } } return list; } }