I think I understand how class-loading hierarchies work. (the JVM looks into the parent hierarchy first)
So I would like to create a ClassLoader, or use an existing
Simply use the URLClassLoader and supply null as the parent.
URLClassLoader
null
File myDir = new File("/some/directory/"); ClassLoader loader = null; try { URL url = myDir.toURL(); URL[] urls = new URL[]{url}; loader = new URLClassLoader(urls, null); } catch (MalformedURLException e) { // oops }