The subject is quite complex, so your best take is to just redeploy your application. There is no explicit way in java to completely get rid of a loaded class. It will only be garbage collected when all references to it are gone, and you usually have no control over this.
Thanks for the reply Dimitris...
I have an ear with several jars (normal and EJB) and wars inside.
When I redeploy a jar and flush the Repository, there are still the old classes loaded. This is like you described above that you have no control over the classloading inside the jvm.
But is there no way to cut all references to the loaded classes from the ear, that all the loaded classes would be garbage-collected and the redeployed would be loaded?
When I redeploy the whole ear, then the old classes are no more loaded an by a call to the classes the new ones would be loaded. What happens by this scenario? Are there no ways to force this whitout a redeploy of the whole ear?