aspose file tools*
The moose likes Java in General and the fly likes Reload a modified java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reload a modified java class " Watch "Reload a modified java class " New topic
Author

Reload a modified java class

Manu Somasekhar
Ranch Hand

Joined: May 22, 2012
Posts: 44
Hi,

I was doing some byte code injection with asm. I tried to inject some code to the class file. But it is found that if I tried to find the injected code, it is not available within the already loaded class. So a clean restart of JVM is required to find the injected code within the object.
So I was wondering how can I reload a class without restarting the JVM ?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Byte code injection and class loading aren't really beginning topics, so I'm going to move this thread.
Manu Somasekhar
Ranch Hand

Joined: May 22, 2012
Posts: 44
Thanks Paul.

Once again I am answering to my own question.

In order to achieve what I mentioned, one needs to extend ClassLoader and try to reload the classes when ever required.

I got the answer from here


webpage
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reload a modified java class