Dynamically load a jar at runtime

A short post but I figured I would throw it up here before I lose my code. There are a couple of different ways that you can load jar’d code at runtime but here is a simple solution that I found to work very easily. File myJar = new File("myJar.jar"); URL url = myJar.toURI().toURL(); Class<?>[] parameters = new Class[]{URL.class}; URLClassLoader sysLoader = (URLClassLoader)ClassLoader.getSystemClassLoader(); Class sysClass = URLClassLoader.class; try { Method method = sysClass.