Created
January 3, 2013 01:22
-
-
Save yujuwon/4440027 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
public class DynamicLibCall | |
{ | |
public static void main(String[] args) | |
{ | |
String libPath = "DynamicLib.jar"; | |
File libFile = new File(libPath); | |
URL classURL = new URL("jar:" + file.toURI().toURL() + "!/"); | |
URLClassLoader classLoader = new URLClassLoader(new URL [] {classURL}); | |
Class test1 = classLoader.loadClass("com.company.test.test1"); | |
Object obj1 = clazz1.newInstance(); | |
System.out.println(obj1.toString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment