0

In my project I'm downloading an Applet and then adding it to the classpath and displaying it, however it doesn't seem to be able to find the resource files

File f = new File("jars/myAppletJar.jar");
URLClassLoader urlCl = new URLClassLoader(new URL[]{f.toURL()},System.class.getClassLoader());
Class clazz = urlCl.loadClass("MyAppletMainClazz");
String[] args = {};
new MainFrame((Applet) clazz.newInstance(), args, 400, 400);

It throws a null pointer when attempting to find the resources in that jar. The applet works fine with run on its own.

How do I load the resources from the dynamically added jar into the classpath?

Rulasmur
  • 11
  • 3
  • @ParkerHalo not really.... Rulasmur Can you please share the stacktrace – Sercan Ozdemir Nov 30 '15 at 09:41
  • No, The stacktrace bares no relevance beyond informing me that the files are not on the classpath. As stated in the question, the applet works when run standalone, however when dynamically loaded into the class path, it fails to find the resources from the jar. – Rulasmur Nov 30 '15 at 09:54

0 Answers0