Create Classloader with only classes inside specific folder
问题 I want to load specific jars in ScriptEngineManager using specific ClassLoader This constructor loads the implementations of ScriptEngineFactory visible to the given ClassLoader using the service provider mechanism. The problem when I tried to create Classloader File file = new File("c:\\myclasses\\"); try { // Convert File to a URL URL url = file.toURI().toURL(); // file:/c:/myclasses/ URL[] urls = new URL[]{url}; // Create a new class loader with the directory ClassLoader cl = new