MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / addJar

Method addJar

Skay_Exp/src/tools/ClassLoaderUtils.java:87–101  ·  view source on GitHub ↗
(File jarPath)

Source from the content-addressed store, hash-verified

85
86
87 public static void addJar(File jarPath) {
88 try {
89 URLClassLoader classLoader = (URLClassLoader)FXMLDocumentController.class.getClassLoader();
90 Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
91 if (!method.isAccessible()) {
92 method.setAccessible(true);
93 }
94
95 URL url = jarPath.toURI().toURL();
96 method.invoke(classLoader, url);
97 } catch (Exception var4) {
98 var4.printStackTrace();
99 }
100
101 }
102
103
104 public static Object invoke(Object obj, String methodName, Object... parameters) {

Callers 1

initvullistMethod · 0.95

Calls 1

invokeMethod · 0.80

Tested by

no test coverage detected