Here you can find the source of load(String className)
public static Class<?> load(String className) throws ClassNotFoundException
//package com.java2s; //License from project: Open Source License import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; public class Main { @SuppressWarnings("resource") public static Class<?> load(String jarpath, String className) throws ClassNotFoundException, MalformedURLException { URL url = new URL("file:" + jarpath); URLClassLoader myClassLoader = new URLClassLoader(new URL[] { url }, Thread.currentThread().getContextClassLoader()); return myClassLoader.loadClass(className); }//from www. ja v a2 s .co m public static Class<?> load(String className) throws ClassNotFoundException { return Class.forName(className); } }