File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Programatically unloading a class ...

 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there a way to unload my .class files rogramatically ???

I want to unload a class then reload it, i know how to load, but is there a way to unload then reload ???

Thanks in advance ...
 
Peter Chase
Ranch Hand
Posts: 1970
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can't unload a class.

If a class was loaded by a ClassLoader other than the main system class loader, the class will be garbage-collected along with the ClassLoader, when there are no more references to any classes from that ClassLoader.

While you cannot unload a class, you can load a new copy of the class, using a new ClassLoader. That's what people in your situation usually do. It is not trivial to get correct, however.
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir ...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic