Here you can find the source of loadJar(String path)
public static ClassLoader loadJar(String path) throws MalformedURLException
//package com.java2s; //License from project: Apache License import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; public class Main { public static ClassLoader loadJar(String path) throws MalformedURLException { URL url = new File(path).toURI().toURL(); URL[] urls = new URL[] { url }; return new URLClassLoader(urls); }/*from w w w.ja v a2 s. co m*/ }