Possible Duplicate:
How do I programmatically compile and instantiate a Java class?
How to create a new java class at runtime?
Use
Class<?> ClassLoader.defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain)
The problem is that this method is protected. So, you should extend class loader with your own class and call this method from there.
精彩评论