Some sun.misc internal APIs are deprectaed in JDK 9 and will be encapsulated or removed in a future release.
static public URL[] pathToURLs(String classpath) { return URLClassPath.pathToURLs(classpath); }
private static Collection<String> getClasspathElements() { String classPath = System.getProperty("java.class.path"); URL[] classpathElements = URLClassPath.pathToURLs(classPath); Set<String> classPathItems = new HashSet<String>(); for (URL cpElem : classpathElements) { classPathItems.add(cpElem.getFile()); } return classPathItems; }