I'm trying to make a class loader that will load .class files inside a .zip file. I followed this tutorial (https://weblogs.java.net/blog/2008/07/25/how-load-classes-jar-or-zip), but when i run the program, i get this error:
java.lang.LinkageError: loader (instance of org/freeforums/geforce/genforcer/main/ZipClassLoader): attempted duplicate class definition for name: "test/TestClass"
The error comes from line 30, which is:
return defineClass(filename, out.toByteArray, 0, out.size());
I call the method by using:
zipClassLoaderObj.findClass("test.TestClass");
Does anyone know what i'm doing wrong?