Java: defineClass and inner classes
In my own classloader I get all entries from jar file and use defineClass() to load classes to memory.
My 开发者_StackOverflow中文版problem is that if jar has inner classes (e.g. MyClass$1.class) the defineClass method fails with java.lang.NoClassDefFoundError: IllegalName
exception.
Obviously java needs all files from jar to make it work but how the inner classes can be loaded?
MyClass$1.class should match an anonymous inner class. If your inner class is named, it should be MyClass$InnerClass.class
精彩评论