I want to add some compiled classes (.class files) to directories(packages) in current Jar file at runtime
How can I do that?
Thanks
I'm not quite sure but I don't think it's possible to load classes from a JAR file (let's call it foo.jar), then modify the very same JAR file from which the classes were loaded, add a new class and expect the class to be found by the ClassLoader.
I'd think about refactoring the application itself and make it able to load classes dynamically (using URLClassLoader or any other technique) than trying to force the single JAR behaviour you described.