Not with serialization, you will have to store class files separately, as well as evaluate dependencies and link them too.
So, you have to serialize the object, find its .class , detect dependent classes, find .class files, and so on, until all dependencies are resolved.
As you could imagine, this is not an easy task, so submit this material with your jar class file and do it.
source share